mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -1303,7 +1303,7 @@ def describe(thing):
|
||||||
|
|
||||||
def locate(path, forceload=0):
|
def locate(path, forceload=0):
|
||||||
"""Locate an object by name or dotted path, importing as necessary."""
|
"""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
|
module, n = None, 0
|
||||||
while n < len(parts):
|
while n < len(parts):
|
||||||
nextmodule = safeimport(join(parts[:n+1], '.'), forceload)
|
nextmodule = safeimport(join(parts[:n+1], '.'), forceload)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue