From a7987e71939fa631296f83861fb376361ddd59ee Mon Sep 17 00:00:00 2001 From: AraHaan <15173749+AraHaan@users.noreply.github.com> Date: Sat, 23 Mar 2019 12:29:49 -0400 Subject: [PATCH] bpo-32217: Correct usage of ABI tags in freeze. (GH-4719) Check for sys.abiflags before using since not all platforms have it defined. --- .../Tools-Demos/2017-12-19-20-42-36.bpo-32217.axXcjA.rst | 1 + Tools/freeze/freeze.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tools-Demos/2017-12-19-20-42-36.bpo-32217.axXcjA.rst 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 00000000000..67feb9e9c3c --- /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 08d09e70620..3ab56fd0fe1 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: