Patchwork py3: stringify setupversion on Windows

login
register
mail settings
Submitter Matt Harbison
Date Oct. 20, 2018, 2:37 a.m.
Message ID <9a6381bc4f3274cef011.1540003062@Envy>
Download mbox | patch
Permalink /patch/36203/
State Accepted
Headers show

Comments

Matt Harbison - Oct. 20, 2018, 2:37 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1540002707 14400
#      Fri Oct 19 22:31:47 2018 -0400
# Node ID 9a6381bc4f3274cef01128948b9afb94f97e67f7
# Parent  e2173cfb0be91129c66d499e2449f06e4d4b8eec
py3: stringify setupversion on Windows

This was stringified a few lines above for non Windows platforms, but `version`
remains bytes.  The old code effectively undid the conversion, and triggered a
warning in setuptools when building.
Yuya Nishihara - Oct. 20, 2018, 7:01 a.m.
On Fri, 19 Oct 2018 22:37:42 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1540002707 14400
> #      Fri Oct 19 22:31:47 2018 -0400
> # Node ID 9a6381bc4f3274cef01128948b9afb94f97e67f7
> # Parent  e2173cfb0be91129c66d499e2449f06e4d4b8eec
> py3: stringify setupversion on Windows

Queued, thanks.

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1063,7 +1063,7 @@  if py2exeloaded:
 if os.name == 'nt':
     # Windows binary file versions for exe/dll files must have the
     # form W.X.Y.Z, where W,X,Y,Z are numbers in the range 0..65535
-    setupversion = version.split(b'+', 1)[0]
+    setupversion = setupversion.split(r'+', 1)[0]
 
 if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'):
     version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[1].splitlines()