提交 00b329cd authored 作者: Frederic Bastien's avatar Frederic Bastien

better error msg

上级 61b514a0
...@@ -71,8 +71,14 @@ try: ...@@ -71,8 +71,14 @@ try:
else: else:
try_import() try_import()
_need_reload = True _need_reload = True
if version != getattr(lazylinker_ext, '_version', None): actual_version = getattr(lazylinker_ext, '_version', None)
raise ImportError() 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: except ImportError:
get_lock() get_lock()
try: try:
...@@ -88,8 +94,15 @@ except ImportError: ...@@ -88,8 +94,15 @@ except ImportError:
else: else:
try_import() try_import()
_need_reload = True _need_reload = True
if version != getattr(lazylinker_ext, '_version', None): actual_version = getattr(lazylinker_ext, '_version', None)
raise ImportError() 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: except ImportError:
# It is useless to try to compile if there isn't any # It is useless to try to compile if there isn't any
# compiler! But we still want to try to load it, in case # compiler! But we still want to try to load it, in case
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论