Merge pull request #6868 from bluetech/simplify-exc
Simplify some exception handling code
This commit is contained in:
@@ -513,8 +513,7 @@ class Module(nodes.File, PyCollector):
|
||||
mod = self.fspath.pyimport(ensuresyspath=importmode)
|
||||
except SyntaxError:
|
||||
raise self.CollectError(ExceptionInfo.from_current().getrepr(style="short"))
|
||||
except self.fspath.ImportMismatchError:
|
||||
e = sys.exc_info()[1]
|
||||
except self.fspath.ImportMismatchError as e:
|
||||
raise self.CollectError(
|
||||
"import file mismatch:\n"
|
||||
"imported module %r has this __file__ attribute:\n"
|
||||
|
||||
Reference in New Issue
Block a user