From 23cbe85e9ff5b2c5ecb8623ea1716344d82d94e2 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 21 Sep 2011 19:19:01 +0200 Subject: [PATCH] Fix #544: allow .pyw extension for importable modules. --- sphinx/util/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index 4749ca143..b7e64b116 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -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):