some new features

This commit is contained in:
ilgazca
2025-07-30 18:53:50 +03:00
parent 8019bd3b7c
commit 079804a0fc
2118 changed files with 297840 additions and 502 deletions

View File

@ -0,0 +1,18 @@
import contextlib
from .py39 import import_helper
@contextlib.contextmanager
def isolated_modules():
"""
Save modules on entry and cleanup on exit.
"""
(saved,) = import_helper.modules_setup()
try:
yield
finally:
import_helper.modules_cleanup(saved)
vars(import_helper).setdefault('isolated_modules', isolated_modules)

View File

@ -0,0 +1,13 @@
"""
Backward-compatability shims to support Python 3.9 and earlier.
"""
from jaraco.test.cpython import from_test_support, try_import
import_helper = try_import('import_helper') or from_test_support(
'modules_setup', 'modules_cleanup', 'DirsOnSysPath'
)
os_helper = try_import('os_helper') or from_test_support('temp_dir')
warnings_helper = try_import('warnings_helper') or from_test_support(
'ignore_warnings', 'check_warnings'
)