-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-45019: Silence a warning in test_ctypes. #28362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
12e1e0e
549b655
6290438
b45e0d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| A testcase which accesses *values* in a dll. | ||
| """ | ||
|
|
||
| import imp | ||
| import _imp | ||
| import importlib.util | ||
| import unittest | ||
| import sys | ||
|
|
@@ -73,15 +73,17 @@ class struct_frozen(Structure): | |
| self.assertTrue([entry.code[i] for i in range(abs(entry.size))]) | ||
| # Check the module's package-ness. | ||
| with import_helper.frozen_modules(): | ||
| spec = importlib.util.find_spec(modname) | ||
| # Hide the message written by the __hello__ module. | ||
| with captured_stdout(): | ||
| spec = importlib.util.find_spec(modname) | ||
|
||
| if entry.size < 0: | ||
| # It's a package. | ||
| self.assertIsNotNone(spec.submodule_search_locations) | ||
| else: | ||
| self.assertIsNone(spec.submodule_search_locations) | ||
|
|
||
| with import_helper.frozen_modules(): | ||
| expected = imp._frozen_module_names() | ||
| expected = _imp._frozen_module_names() | ||
| self.maxDiff = None | ||
| self.assertEqual(modules, expected, "PyImport_FrozenModules example " | ||
| "in Doc/library/ctypes.rst may be out of date") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can drop this comment.