提交 efa48ecb 编写于 作者: C Carl Meyer

avoid raw ImportError on nonexistent command

上级 143851ba
...@@ -189,7 +189,10 @@ def load_command(name): ...@@ -189,7 +189,10 @@ def load_command(name):
full_name = 'pip.commands.%s' % name full_name = 'pip.commands.%s' % name
if full_name in sys.modules: if full_name in sys.modules:
return return
__import__(full_name) try:
__import__(full_name)
except ImportError:
pass
def load_all_commands(): def load_all_commands():
for name in command_names(): for name in command_names():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册