]> granicus.if.org Git - python/commitdiff
Fix for SF 686380, from SF patch 686771 by Ping. (errors trying to
authorGuido van Rossum <guido@python.org>
Sun, 16 Feb 2003 01:12:32 +0000 (01:12 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 16 Feb 2003 01:12:32 +0000 (01:12 +0000)
get help on os attributes)

Lib/pydoc.py

index e27adb92244f847ca90146af749e29d2fbbde227..451373320324f5aa6f8db5bb319b04590e46da01 100755 (executable)
@@ -1303,7 +1303,7 @@ def describe(thing):
 
 def locate(path, forceload=0):
     """Locate an object by name or dotted path, importing as necessary."""
-    parts = split(path, '.')
+    parts = [part for part in split(path, '.') if part]
     module, n = None, 0
     while n < len(parts):
         nextmodule = safeimport(join(parts[:n+1], '.'), forceload)