@@ -5,13 +5,13 @@ from __future__ import absolute_import
55from __future__ import division
66from __future__ import print_function
77
8- import sys
8+ # Generated file from @rules_python//python/private:python_bootstrap_template.txt
99
10- import os
1110from os .path import dirname , join , basename
12- import subprocess
13- import uuid
11+ import os
1412import shutil
13+ import subprocess
14+ import sys
1515
1616# NOTE: The sentinel strings are split (e.g., "%stage2" + "_bootstrap%") so that
1717# the substitution logic won't replace them. This allows runtime detection of
7777ADDITIONAL_INTERPRETER_ARGS = os .environ .get ("RULES_PYTHON_ADDITIONAL_INTERPRETER_ARGS" , "" )
7878EXTRACT_ROOT = os .environ .get ("RULES_PYTHON_EXTRACT_ROOT" )
7979
80- def is_running_from_zip ():
81- return IS_ZIPFILE
82-
83- if is_running_from_zip ():
80+ if IS_ZIPFILE :
8481 import shutil
8582 import tempfile
8683 import zipfile
@@ -397,7 +394,7 @@ def runfiles_envvar(runfiles_root):
397394 return ('RUNFILES_DIR' , runfiles )
398395
399396 # If running from a zip, there's no manifest file.
400- if is_running_from_zip () :
397+ if IS_ZIPFILE :
401398 return ('RUNFILES_DIR' , runfiles_root )
402399
403400 # Look for the runfiles "output" manifest, argv[0] + ".runfiles_manifest"
@@ -531,7 +528,7 @@ def main():
531528
532529 delete_dirs = []
533530
534- if is_running_from_zip () :
531+ if IS_ZIPFILE :
535532 runfiles_root = create_runfiles_root ()
536533 # NOTE: dirname() is called because create_runfiles_root() creates a
537534 # sub-directory within a temporary directory, and we want to remove the
@@ -584,7 +581,7 @@ def main():
584581 new_env .update ((key , val ) for key , val in os .environ .items () if key not in new_env )
585582
586583 workspace = None
587- if is_running_from_zip () :
584+ if IS_ZIPFILE :
588585 # If RUN_UNDER_RUNFILES equals 1, it means we need to
589586 # change directory to the right runfiles directory.
590587 # (So that the data files are accessible)
0 commit comments