Skip to content

Commit ae3e161

Browse files
committed
bah
1 parent 839553a commit ae3e161

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎v3/pg_logger.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def setJS(jsStr):
146146
def __restricted_import__(*args):
147147
# filter args to ONLY take in real strings so that someone can't
148148
# subclass str and bypass the 'in' test on the next line
149-
#args = [e for e in args if type(e) is str]
149+
args = [e for e in args if type(e) is str]
150150

151151
if args[0] in ALLOWED_STDLIB_MODULE_IMPORTS + CUSTOM_MODULE_IMPORTS:
152152
imported_mod = BUILTIN_IMPORT(*args)
@@ -1123,6 +1123,8 @@ def _runscript(self, script_str, custom_globals=None):
11231123
del sys.modules['os']
11241124
del sys.modules['os.path']
11251125
del sys.modules['sys']
1126+
# so that ppl don't try to dig up dead objects with gc.get_objects()
1127+
del sys.modules['gc']
11261128

11271129
self.run(script_str, user_globals, user_globals)
11281130
# sys.exit ...

0 commit comments

Comments
 (0)