[Python-checkins] bpo-45019: Silence a warning in test_ctypes. (gh-28362)

ericsnowcurrently webhook-mailer at python.org
Wed Sep 15 15:33:10 EDT 2021


https://github.com/python/cpython/commit/4b30aaa0c9dc4da956199dbd48af9c06089cb271
commit: 4b30aaa0c9dc4da956199dbd48af9c06089cb271
branch: main
author: Eric Snow <ericsnowcurrently at gmail.com>
committer: ericsnowcurrently <ericsnowcurrently at gmail.com>
date: 2021-09-15T13:33:05-06:00
summary:

bpo-45019: Silence a warning in test_ctypes. (gh-28362)

This was missed in PR gh-28319.

https://bugs.python.org/issue45019

files:
M Lib/ctypes/test/test_values.py

diff --git a/Lib/ctypes/test/test_values.py b/Lib/ctypes/test/test_values.py
index 03bc9bba31757..4f525cde69e86 100644
--- a/Lib/ctypes/test/test_values.py
+++ b/Lib/ctypes/test/test_values.py
@@ -2,7 +2,7 @@
 A testcase which accesses *values* in a dll.
 """
 
-import imp
+import _imp
 import importlib.util
 import unittest
 import sys
@@ -81,7 +81,7 @@ class struct_frozen(Structure):
                     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")



More information about the Python-checkins mailing list