From ebb6b2205ee72ee4085cf04848e8b2bd8e56e214 Mon Sep 17 00:00:00 2001 From: nop Date: Sun, 11 Oct 2020 03:34:30 +0800 Subject: [PATCH] Fix version < Python 2.7.9 error The tuple form has not always been 100 % compatible, as there was a bug in handling of exec in functions with nested functions (issue 21591); Reference: https://stackoverflow.com/a/41368813 --- pupy/scriptlets/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pupy/scriptlets/__init__.py b/pupy/scriptlets/__init__.py index 98eefea09..cff874cdb 100644 --- a/pupy/scriptlets/__init__.py +++ b/pupy/scriptlets/__init__.py @@ -331,8 +331,7 @@ def parse_scriptlet(filedir, filename): metadata = compile(meta, 'metadata-'+filename, 'exec') metadict = {} - exec (metadata, metadict) - del metadict['__builtins__'] + eval(metadata, globals(), metadict) docstring = '\n'.join( x.strip() for x in docstrings