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
Remove _get_build_version
  • Loading branch information
ZeroIntensity committed Jul 23, 2026
commit b04411dda99b4c56651801e5e141b14657c08ab4
26 changes: 0 additions & 26 deletions Lib/ctypes/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,6 @@

# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":

def _get_build_version():
"""Return the version of MSVC that was used to build Python.

For Python 2.3 and up, the version number is included in
sys.version. For earlier versions, assume the compiler is MSVC 6.
"""
# This function was copied from Lib/distutils/msvccompiler.py
prefix = "MSC v."
i = sys.version.find(prefix)
if i == -1:
return 6
i = i + len(prefix)
s, rest = sys.version[i:].split(" ", 1)
majorVersion = int(s[:-2]) - 6
if majorVersion >= 13:
majorVersion += 1
minorVersion = int(s[2:3]) / 10.0
# I don't think paths are affected by minor version in version 6
if majorVersion == 6:
minorVersion = 0
if majorVersion >= 6:
return majorVersion + minorVersion
# else we don't know what version of the compiler this is
return None

def find_msvcrt():
"""Return the name of the VC runtime dll.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This renders _get_build_version unused. Can it be removed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZeroIntensity, as you'll be doing this more often: consider doing deprecation periods for underscored API as well, if there's no harm in keeping things around for a few more years.
Most of the module predates clear docs on what the underscore means, so existing code might use such functions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, thanks for the reminder. I think this one is okay because I couldn't find any uses of it after a quick code search.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is more of a general reminder of what to keep in mind.
As for code searches, be careful -- this stuff also predates GitHub's hegemony.

This is soft deprecated as of Python 3.16."""
Expand Down
Loading