mirror of
https://github.com/Tygs/0bin.git
synced 2023-08-10 21:13:00 +03:00

Problem with import is that it: - Reuses already-imported module. For example, --settings-file=/etc/zerobin.py won't be imported, because sys.modules will already contain 'zerobin' entry. - Alters sys.path. Importing module from a heavily-populated directory may potentially cause next imports to run code from totally unexpected places. Using execfile() doesn't set some globals like __file__ as import does, which has to be done manually. It also might be a bit slower for large body of code in settings file. runpy.run_path() can only be used on python-2.7, but does not seem to have any downsides.