compiler.py: early return in compiler_environment when no modules (#29441)

This commit is contained in:
Harmen Stoppels
2022-03-14 12:27:49 +01:00
committed by GitHub
parent ccfaec7b1c
commit 474493713b

View File

@@ -598,6 +598,11 @@ def __str__(self):
@contextlib.contextmanager
def compiler_environment(self):
# yield immediately if no modules
if not self.modules:
yield
return
# store environment to replace later
backup_env = os.environ.copy()