Unverified 提交 b2fdd67a authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #6575 from nouiz/err_msg

Better error msg
......@@ -71,8 +71,14 @@ try:
else:
try_import()
_need_reload = True
if version != getattr(lazylinker_ext, '_version', None):
raise ImportError()
actual_version = getattr(lazylinker_ext, '_version', None)
if version != actual_version:
raise ImportError(
"Version check of the existing lazylinker compiled file."
" Looking for version %s, but found %s. "
"Extra debug information: force_compile=%s, _need_reload=%s" % (
version,
actual_version, force_compile, _need_reload))
except ImportError:
get_lock()
try:
......@@ -88,8 +94,15 @@ except ImportError:
else:
try_import()
_need_reload = True
if version != getattr(lazylinker_ext, '_version', None):
raise ImportError()
actual_version = getattr(lazylinker_ext, '_version', None)
if version != actual_version:
raise ImportError(
"Version check of the existing lazylinker compiled file."
" Looking for version %s, but found %s. "
"Extra debug information: force_compile=%s,"
" _need_reload=%s" % (
version,
actual_version, force_compile, _need_reload))
except ImportError:
# It is useless to try to compile if there isn't any
# compiler! But we still want to try to load it, in case
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论