Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use the import_helper for even fewer LOC
  • Loading branch information
ambv committed Jul 30, 2024
commit fa61261526307530cf002e9842fa196ff6c92bd0
8 changes: 2 additions & 6 deletions Lib/test/test_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import fractions
import gc
import io
import importlib
import locale
import math
import os
Expand All @@ -32,6 +31,7 @@
from operator import neg
from test import support
from test.support import (cpython_only, swap_attr, maybe_get_event_loop_policy)
from test.support.import_helper import import_module
from test.support.os_helper import (EnvironmentVarGuard, TESTFN, unlink)
from test.support.script_helper import assert_python_ok
from test.support.warnings_helper import check_warnings
Expand Down Expand Up @@ -2413,11 +2413,7 @@ def detach_readline(self):
# since test_builtin is not intended to test
# the readline module, but the builtins module.
if "readline" in sys.modules:
try:
c = importlib.import_module("ctypes")
except ImportError:
self.skipTest("the readline module is loaded")

c = import_module("ctypes")
fp_api = "PyOS_ReadlineFunctionPointer"
prev_value = c.c_void_p.in_dll(c.pythonapi, fp_api).value
c.c_void_p.in_dll(c.pythonapi, fp_api).value = None
Expand Down