File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ def generate_imports_for_referenced_namespaces(
103
103
for ns in imported_namespaces :
104
104
backend .emit (ns .name + ',' )
105
105
backend .emit (')' )
106
- backend .emit ('except (SystemError, ValueError):' )
106
+ backend .emit ('except (ImportError, SystemError, ValueError):' )
107
107
# Fallback if imported from outside a package.
108
108
with backend .indent ():
109
109
for ns in imported_namespaces :
@@ -119,7 +119,7 @@ def generate_imports_for_referenced_namespaces(
119
119
try:
120
120
from . import stone_validators as bv
121
121
from . import stone_base as bb
122
- except (SystemError, ValueError):
122
+ except (ImportError, SystemError, ValueError):
123
123
# Catch errors raised when importing a relative module when not in a package.
124
124
# This makes testing this file directly (outside of a package) easier.
125
125
import stone_validators as bv{type_ignore_comment}
Original file line number Diff line number Diff line change 10
10
11
11
try :
12
12
from . import stone_validators as bv
13
- except (SystemError , ValueError ):
13
+ except (ImportError , SystemError , ValueError ):
14
14
# Catch errors raised when importing a relative module when not in a package.
15
15
# This makes testing this file directly (outside of a package) easier.
16
16
import stone_validators as bv # type: ignore
Original file line number Diff line number Diff line change 24
24
try :
25
25
from . import stone_base as bb # noqa: F401 # pylint: disable=unused-import
26
26
from . import stone_validators as bv
27
- except (SystemError , ValueError ):
27
+ except (ImportError , SystemError , ValueError ):
28
28
# Catch errors raised when importing a relative module when not in a package.
29
29
# This makes testing this file directly (outside of a package) easier.
30
30
import stone_validators as bb # type: ignore # noqa: F401 # pylint: disable=unused-import
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ def _api():
180
180
try:
181
181
from . import stone_validators as bv
182
182
from . import stone_base as bb
183
- except (SystemError, ValueError):
183
+ except (ImportError, SystemError, ValueError):
184
184
# Catch errors raised when importing a relative module when not in a package.
185
185
# This makes testing this file directly (outside of a package) easier.
186
186
import stone_validators as bv # type: ignore
You can’t perform that action at this time.
0 commit comments