Browse Source

Merge pull request #144 from pypa/bugfix/140-resources-39

Use files API on Python 3.9 and later.
pull/146/head
Pradyun Gedam 2 months ago committed by GitHub
parent
commit
ab2763988a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      pep517/in_process/__init__.py

14
pep517/in_process/__init__.py

@ -9,10 +9,18 @@ from os.path import join as pjoin
try:
import importlib.resources as resources
def _in_proc_script_path():
return resources.path(__package__, '_in_process.py')
try:
resources.files
except AttributeError:
# Python 3.8 compatibility
def _in_proc_script_path():
return resources.path(__package__, '_in_process.py')
else:
def _in_proc_script_path():
return resources.as_file(
resources.files(__package__).joinpath('_in_process.py'))
except ImportError:
# Python 3.6 compatibility
@contextmanager
def _in_proc_script_path():
yield pjoin(dirname(abspath(__file__)), '_in_process.py')

Loading…
Cancel
Save