I'm trying out a coding challange right now. I cannot change the code before
del __builtins__.__dict__["__import__"]
but must use import afterwards. I need a way to restore the default __builtins__
. Its python 2.7.
I tryed __builtins__ = [x for x in (1).__class__.__base__.__subclasses__() if x.__name__ == 'catch_warnings'][0]()._module.__builtins__
but that doesn't work because the reference to builtins hasn't gone but the element from the dictionary of builtins are.