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

This commit is contained in:
Georg Brandl 2010-10-22 09:40:03 +02:00
parent 39dc69e9d9
commit c768b68340
3 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,8 @@
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.

View File

@ -659,7 +659,7 @@ class Documenter(object):
# parse right now, to get PycodeErrors on parsing (results will
# be cached anyway)
self.analyzer.find_attr_docs()
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

View File

@ -204,7 +204,7 @@ def get_module_source(modname):
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)