File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ def generate_imports_for_referenced_namespaces(
103103 for ns in imported_namespaces :
104104 backend .emit (ns .name + ',' )
105105 backend .emit (')' )
106- backend .emit ('except (SystemError, ValueError):' )
106+ backend .emit ('except (ImportError, SystemError, ValueError):' )
107107 # Fallback if imported from outside a package.
108108 with backend .indent ():
109109 for ns in imported_namespaces :
@@ -119,7 +119,7 @@ def generate_imports_for_referenced_namespaces(
119119 try:
120120 from . import stone_validators as bv
121121 from . import stone_base as bb
122- except (SystemError, ValueError):
122+ except (ImportError, SystemError, ValueError):
123123 # Catch errors raised when importing a relative module when not in a package.
124124 # This makes testing this file directly (outside of a package) easier.
125125 import stone_validators as bv{type_ignore_comment}
Original file line number Diff line number Diff line change 1010
1111try :
1212 from . import stone_validators as bv
13- except (SystemError , ValueError ):
13+ except (ImportError , SystemError , ValueError ):
1414 # Catch errors raised when importing a relative module when not in a package.
1515 # This makes testing this file directly (outside of a package) easier.
1616 import stone_validators as bv # type: ignore
Original file line number Diff line number Diff line change 2424try :
2525 from . import stone_base as bb # noqa: F401 # pylint: disable=unused-import
2626 from . import stone_validators as bv
27- except (SystemError , ValueError ):
27+ except (ImportError , SystemError , ValueError ):
2828 # Catch errors raised when importing a relative module when not in a package.
2929 # This makes testing this file directly (outside of a package) easier.
3030 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():
180180try:
181181 from . import stone_validators as bv
182182 from . import stone_base as bb
183- except (SystemError, ValueError):
183+ except (ImportError, SystemError, ValueError):
184184 # Catch errors raised when importing a relative module when not in a package.
185185 # This makes testing this file directly (outside of a package) easier.
186186 import stone_validators as bv # type: ignore
You can’t perform that action at this time.
0 commit comments