File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1827,17 +1827,25 @@ def write_core_py_preamble(core_py):
1827
1827
core_py .write (
1828
1828
"""
1829
1829
# Automatically generated file
1830
+ import atexit
1830
1831
import sys, os
1832
+ import contextlib
1831
1833
import ctypes
1832
- import pkg_resources
1834
+ import importlib_resources
1833
1835
from .z3types import *
1834
1836
from .z3consts import *
1835
1837
1838
+ _file_manager = contextlib.ExitStack()
1839
+ atexit.register(_file_manager.close)
1836
1840
_ext = 'dll' if sys.platform in ('win32', 'cygwin') else 'dylib' if sys.platform == 'darwin' else 'so'
1837
1841
_lib = None
1842
+ _z3_lib_resource = importlib_resources.files('z3', 'lib')
1843
+ _z3_lib_resource_path = _file_manager.enter_context(
1844
+ importlib_resources.as_file(_z3_lib_resource)
1845
+ )
1838
1846
_default_dirs = ['.',
1839
1847
os.path.dirname(os.path.abspath(__file__)),
1840
- pkg_resources.resource_filename('z3', 'lib') ,
1848
+ _z3_lib_resource_path ,
1841
1849
os.path.join(sys.prefix, 'lib'),
1842
1850
None]
1843
1851
_all_dirs = []
You can’t perform that action at this time.
0 commit comments