compiler.py: early return in compiler_environment when no modules (#29441)
This commit is contained in:
parent
ccfaec7b1c
commit
474493713b
@ -598,6 +598,11 @@ def __str__(self):
|
|||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def compiler_environment(self):
|
def compiler_environment(self):
|
||||||
|
# yield immediately if no modules
|
||||||
|
if not self.modules:
|
||||||
|
yield
|
||||||
|
return
|
||||||
|
|
||||||
# store environment to replace later
|
# store environment to replace later
|
||||||
backup_env = os.environ.copy()
|
backup_env = os.environ.copy()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user