Skip to content

Commit

Permalink
pythongh-119253: use ImportError in _ios_support (python#119254)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored and estyxx committed Jul 17, 2024
1 parent 067e2ea commit 2e9bd0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/_ios_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
# ctypes is an optional module. If it's not present, we're limited in what
# we can tell about the system, but we don't want to prevent the module
# from working.
print("ctypes isn't available; iOS system calls will not be available")
print("ctypes isn't available; iOS system calls will not be available", file=sys.stderr)
objc = None
else:
# ctypes is available. Load the ObjC library, and wrap the objc_getClass,
# sel_registerName methods
lib = util.find_library("objc")
if lib is None:
# Failed to load the objc library
raise RuntimeError("ObjC runtime library couldn't be loaded")
raise ImportError("ObjC runtime library couldn't be loaded")

objc = cdll.LoadLibrary(lib)
objc.objc_getClass.restype = c_void_p
Expand Down

0 comments on commit 2e9bd0e

Please sign in to comment.