mirror of
https://github.com/python/cpython.git
synced 2024-11-27 11:55:13 +08:00
Fix for SF 686380, from SF patch 686771 by Ping. (errors trying to
get help on os attributes)
This commit is contained in:
parent
0ae4c4a823
commit
97dede0202
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user