[Python-checkins] bpo-32217: Correct usage of ABI tags in freeze. (GH-4719)

Cheryl Sabella webhook-mailer at python.org
Sat Mar 23 12:29:54 EDT 2019


https://github.com/python/cpython/commit/a7987e71939fa631296f83861fb376361ddd59ee
commit: a7987e71939fa631296f83861fb376361ddd59ee
branch: master
author: AraHaan <15173749+AraHaan at users.noreply.github.com>
committer: Cheryl Sabella <cheryl.sabella at gmail.com>
date: 2019-03-23T12:29:49-04:00
summary:

bpo-32217: Correct usage of ABI tags in freeze. (GH-4719)

Check for sys.abiflags before using since not all platforms have it defined.

files:
A Misc/NEWS.d/next/Tools-Demos/2017-12-19-20-42-36.bpo-32217.axXcjA.rst
M Tools/freeze/freeze.py

diff --git a/Misc/NEWS.d/next/Tools-Demos/2017-12-19-20-42-36.bpo-32217.axXcjA.rst b/Misc/NEWS.d/next/Tools-Demos/2017-12-19-20-42-36.bpo-32217.axXcjA.rst
new file mode 100644
index 000000000000..67feb9e9c3c5
--- /dev/null
+++ b/Misc/NEWS.d/next/Tools-Demos/2017-12-19-20-42-36.bpo-32217.axXcjA.rst
@@ -0,0 +1 @@
+Fix freeze script on Windows.
diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py
index 08d09e706205..3ab56fd0fe1d 100755
--- a/Tools/freeze/freeze.py
+++ b/Tools/freeze/freeze.py
@@ -217,7 +217,10 @@ def main():
 
     # locations derived from options
     version = '%d.%d' % sys.version_info[:2]
-    flagged_version = version + sys.abiflags
+    if hasattr(sys, 'abiflags'):
+        flagged_version = version + sys.abiflags
+    else:
+        flagged_version = version
     if win:
         extensions_c = 'frozen_extensions.c'
     if ishome:



More information about the Python-checkins mailing list