mirror of
https://github.com/python/cpython.git
synced 2025-09-02 15:07:53 +00:00
Use the str builtin
This commit is contained in:
parent
41103bf6f2
commit
6e024b3842
1 changed files with 1 additions and 2 deletions
|
@ -21,7 +21,6 @@ import marshal
|
||||||
|
|
||||||
__all__ = ["ImportManager","Importer","BuiltinImporter"]
|
__all__ = ["ImportManager","Importer","BuiltinImporter"]
|
||||||
|
|
||||||
_StringType = type('')
|
|
||||||
_ModuleType = type(sys) ### doesn't work in JPython...
|
_ModuleType = type(sys) ### doesn't work in JPython...
|
||||||
|
|
||||||
class ImportManager:
|
class ImportManager:
|
||||||
|
@ -183,7 +182,7 @@ class ImportManager:
|
||||||
# scan sys.path looking for a location in the filesystem that contains
|
# scan sys.path looking for a location in the filesystem that contains
|
||||||
# the module, or an Importer object that can import the module.
|
# the module, or an Importer object that can import the module.
|
||||||
for item in sys.path:
|
for item in sys.path:
|
||||||
if isinstance(item, _StringType):
|
if isinstance(item, str):
|
||||||
module = self.fs_imp.import_from_dir(item, name)
|
module = self.fs_imp.import_from_dir(item, name)
|
||||||
else:
|
else:
|
||||||
module = item.import_top(name)
|
module = item.import_top(name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue