summaryrefslogtreecommitdiff
path: root/examples/fakeroot.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-01-25 17:15:33 +0100
committerHelmut Grohne <helmut@subdivi.de>2024-01-25 17:19:24 +0100
commit75c3b33550624fecb551b16f95ea65bf3323934f (patch)
tree689d86932452de58c5de06dd161de7ce1ae14b0d /examples/fakeroot.py
parentf01c7690de8e9ea1c287d336d32b530c441c458f (diff)
downloadpython-linuxnamespaces-75c3b33550624fecb551b16f95ea65bf3323934f.tar.gz
linuxnamespaces.run_in_fork: use os._exit instead of sys.exit
When using sys.exit, we actually raise a SystemExit exception and as a consequence exit all context managers. If a particular context manager pertains only the process at hand, we don't really care, because our process is supposed to vanish. If a context manager changes external state such as tempfile.NamedTemporaryFile, this is very bad and unexpected. We need to ensure that such cleanup is not performed. This also simplifies the test suite that had to emulate this behaviour already as pytest uses a context manager.
Diffstat (limited to 'examples/fakeroot.py')
0 files changed, 0 insertions, 0 deletions