Skip to content
Closed
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
Only import platform if OS is macOS
  • Loading branch information
sumanthratna authored Jul 1, 2020
commit 0a2ee77547c0e25f081cfb6507a1ab8fecbd683a
4 changes: 2 additions & 2 deletions Lib/ctypes/util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import platform
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -71,7 +70,8 @@ def find_library(name):
elif os.name == "posix" and sys.platform == "darwin":
from ctypes.macholib.dyld import dyld_find as _dyld_find
def find_library(name):
macos_version = platform.mac_ver()[0]
from platform import mac_ver
macos_version = mac_ver()[0]
if macos_version == '10.16' or macos_version == '11.0':
# see https://bugs.python.org/issue41179
# macOS Big Sur no longer copies dynamic libraries
Expand Down