summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorKa-Ping Yee <ping@zesty.ca>2001-04-13 15:00:27 (GMT)
committerKa-Ping Yee <ping@zesty.ca>2001-04-13 15:00:27 (GMT)
commit6191a23537fbb1bd1c3f6293f502f079a20600ef (patch)
treed97104385f270e3114e70798c176e619eec5f5e5 /Lib/pydoc.py
parent79fa2b6073b67ae0351cad5b792f2be815e60c68 (diff)
downloadcpython-6191a23537fbb1bd1c3f6293f502f079a20600ef.zip
cpython-6191a23537fbb1bd1c3f6293f502f079a20600ef.tar.gz
cpython-6191a23537fbb1bd1c3f6293f502f079a20600ef.tar.bz2
Use nturl2path to generate a file: URL to source files in Windows.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index ee9177d..eac1767 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -484,7 +484,11 @@ TT { font-family: lucida typewriter, lucida console, courier }
head = '<big><big><strong>%s</strong></big></big>' % linkedname
try:
path = inspect.getabsfile(object)
- filelink = '<a href="file:%s">%s</a>' % (path, path)
+ url = path
+ if sys.platform == 'win32':
+ import nturl2path
+ url = nturl2path.pathname2url(path)
+ filelink = '<a href="file:%s">%s</a>' % (url, path)
except TypeError:
filelink = '(built-in)'
info = []
@@ -1473,9 +1477,9 @@ class ModuleScanner(Scanner):
return children
def isnewpackage(self, (dir, package)):
- inode = os.stat(dir)[1] # detect circular symbolic links
+ inode = os.path.exists(dir) and os.stat(dir)[1]
if not (os.path.islink(dir) and inode in self.inodes):
- self.inodes.append(inode)
+ self.inodes.append(inode) # detect circular symbolic links
return ispackage(dir)
def run(self, callback, key=None, completer=None):