mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #544: allow .pyw extension for importable modules.
This commit is contained in:
parent
6396adfda2
commit
23cbe85e9f
@ -205,6 +205,8 @@ def get_module_source(modname):
|
||||
lfilename = filename.lower()
|
||||
if lfilename.endswith('.pyo') or lfilename.endswith('.pyc'):
|
||||
filename = filename[:-1]
|
||||
if not path.isfile(filename) and path.isfile(filename + 'w'):
|
||||
filename += 'w'
|
||||
elif not (lfilename.endswith('.py') or lfilename.endswith('.pyw')):
|
||||
raise PycodeError('source is not a .py file: %r' % filename)
|
||||
if not path.isfile(filename):
|
||||
|
Loading…
Reference in New Issue
Block a user