We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
create_builtin()
1 parent e85b222 commit 68e2b7eCopy full SHA for 68e2b7e
Lib/test/test_import/__init__.py
@@ -1253,6 +1253,19 @@ class Spec2:
1253
origin = "a\x00b"
1254
_imp.create_dynamic(Spec2())
1255
1256
+ def test_create_builtin(self):
1257
+ for internal_mod in (sys, builtins):
1258
+ class Spec:
1259
+ name = internal_mod.__name__
1260
+
1261
+ self.assertIs(_imp.create_builtin(Spec()), internal_mod)
1262
1263
1264
+ name = "nonexistent_lib"
1265
1266
+ # gh-142029
1267
+ self.assertIs(_imp.create_builtin(Spec()), None)
1268
1269
def test_filter_syntax_warnings_by_module(self):
1270
module_re = r'test\.test_import\.data\.syntax_warnings\z'
1271
unload('test.test_import.data.syntax_warnings')
0 commit comments