1. Luke Plant
  2. sphinx


Georg Brandl  committed f2ad8a9

#544: Allow ``.pyw`` as a source file extension.

  • Participants
  • Parent commits ff5b505
  • Branches default

Comments (0)

Files changed (3)


View file
 Release 1.0.4 (Sep 17, 2010)
+* #544: Allow ``.pyw`` as a source file extension.
 * #524: Open intersphinx inventories in binary mode on Windows,
   since version 2 contains zlib-compressed data.

File sphinx/ext/autodoc.py

View file
             # parse right now, to get PycodeErrors on parsing (results will
             # be cached anyway)
-        except PycodeError, err:
+        except PycodeError:
             # no source file -- e.g. for builtin and C modules
             self.analyzer = None
             # at least add the module.__file__ as a dependency

File sphinx/util/__init__.py

View file
     lfilename = filename.lower()
     if lfilename.endswith('.pyo') or lfilename.endswith('.pyc'):
         filename = filename[:-1]
-    elif not lfilename.endswith('.py'):
+    elif not (lfilename.endswith('.py') or lfilename.endswith('.pyw')):
         raise PycodeError('source is not a .py file: %r' % filename)
     if not path.isfile(filename):
         raise PycodeError('source file is not present: %r' % filename)