Merge "If only .pyc exist, the extension API will be disabled" into stable/queens

This commit is contained in:
Zuul 2020-04-07 04:45:50 +00:00 committed by Gerrit Code Review
commit cd8c004550
2 changed files with 14 additions and 3 deletions

View File

@ -273,12 +273,16 @@ def load_standard_extensions(ext_mgr, logger, path, package, ext_list=None):
else: else:
relpkg = '.%s' % '.'.join(relpath.split(os.sep)) relpkg = '.%s' % '.'.join(relpath.split(os.sep))
# Now, consider each file in turn, only considering .py files # Now, consider each file in turn, only considering .py and .pyc files
for fname in filenames: for fname in filenames:
root, ext = os.path.splitext(fname) root, ext = os.path.splitext(fname)
# Skip __init__ and anything that's not .py # Skip __init__ and anything that's not .py and .pyc
if ext != '.py' or root == '__init__': if (ext not in ('.py', '.pyc')) or root == '__init__':
continue
# If .pyc and .py both exist, skip .pyc
if ext == '.pyc' and ((root + '.py') in filenames):
continue continue
# Try loading it # Try loading it

View File

@ -0,0 +1,7 @@
---
fixes:
- |
`Launchpad bug 1869148 <https://launchpad.net/bugs/1869148>`_ has been
fixed. This bug could have affected environments where extension APIs were
provided in compiled files rather than source code.