[Epydoc-commits] SF.net SVN: epydoc: [1310] trunk/epydoc/src/epydoc/util.py
Brought to you by:
edloper
From: <ed...@us...> - 2006-08-23 16:17:24
|
Revision: 1310 Author: edloper Date: 2006-08-23 09:17:18 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/epydoc/?rev=1310&view=rev Log Message: ----------- - changed is_module_file() and is_package_dir() to return false when given a non-string object (rather than raising an exception) Modified Paths: -------------- trunk/epydoc/src/epydoc/util.py Modified: trunk/epydoc/src/epydoc/util.py =================================================================== --- trunk/epydoc/src/epydoc/util.py 2006-08-23 15:58:06 UTC (rev 1309) +++ trunk/epydoc/src/epydoc/util.py 2006-08-23 16:17:18 UTC (rev 1310) @@ -26,6 +26,9 @@ PY_BIN_EXTENSIONS = ['.pyc', '.so', '.pyd'] def is_module_file(path): + # Make sure it's a file name. + if not isinstance(path, basestring): + return False (dir, filename) = os.path.split(path) (basename, extension) = os.path.splitext(filename) return (os.path.isfile(path) and @@ -42,7 +45,9 @@ (i.e., it names a directory that contsains a valid __init__ file, and its name is a valid identifier). """ - # Make sure it's a directory. + # Make sure it's a directory name. + if not isinstance(dirname, basestring): + return False if not os.path.isdir(dirname): return False dirname = os.path.abspath(dirname) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |