]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-119253: use ImportError in _ios_support (GH-119254) (#119265)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 20 May 2024 22:21:28 +0000 (00:21 +0200)
committerGitHub <noreply@github.com>
Mon, 20 May 2024 22:21:28 +0000 (22:21 +0000)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Lib/_ios_support.py

index db3fe23e45bca094907b967e7c0c5f4ffb169399..20467a7c2bcaeb06e4fefb43de9d20bf73b0ee54 100644 (file)
@@ -5,7 +5,7 @@ except ImportError:
     # 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,
@@ -13,7 +13,7 @@ else:
     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