##// END OF EJS Templates
resourceutil: document when we expect to take the importlib.resouces code path...
Martin von Zweigbergk -
r46024:dd9e2861 default
parent child Browse files
Show More
@@ -55,6 +55,8 b' else:'
55
55
56
56
57 try:
57 try:
58 # importlib.resources exists from Python 3.7; see fallback in except clause
59 # further down
58 from importlib import resources
60 from importlib import resources
59
61
60 from .. import encoding
62 from .. import encoding
@@ -78,6 +80,8 b' try:'
78
80
79
81
80 except (ImportError, AttributeError):
82 except (ImportError, AttributeError):
83 # importlib.resources was not found (almost definitely because we're on a
84 # Python version before 3.7)
81
85
82 def open_resource(package, name):
86 def open_resource(package, name):
83 path = os.path.join(_package_path(package), name)
87 path = os.path.join(_package_path(package), name)
General Comments 0
You need to be logged in to leave comments. Login now