Last active
August 28, 2023 21:55
-
-
Save qexat/79d0c8a7c667ef9a262ec56e8fb2670e to your computer and use it in GitHub Desktop.
become unrunnable. 💪️💪️💪️💪️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| # Printing? No. | |
| del sys.stdout | |
| # Really, no. | |
| del sys.__stdout__ | |
| # Errors? "uhhhh object address: [...] lost sys.stderr" | |
| del sys.stderr | |
| # Recovery of stderr: no | |
| del sys.__stderr__ | |
| # avoid RuntimeError due to dictionary changing size during iteration | |
| _modules = sys.modules.copy() | |
| # Make it impossible to import | |
| for name, module in _modules.items(): | |
| del sys.modules[name] | |
| # Deleting our copy of the modules, hopefully it will get GC'd | |
| del _modules | |
| # Make the import impossibility error even more confusing | |
| del sys.modules | |
| # Carefully deleting what we have imported :P | |
| del sys | |
| # This does not delete System32 don't worry | |
| del os |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment