Patchwork [evolve-ext] py3: fix setup.py --version

login
register
mail settings
Submitter Denis Laxalde
Date Oct. 15, 2019, 9:37 a.m.
Message ID <cdb5b5e5a88e55eddf78.1571132279@steppe.local>
Download mbox | patch
Permalink /patch/42349/
State New
Headers show

Comments

Denis Laxalde - Oct. 15, 2019, 9:37 a.m.
# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1570805473 -7200
#      Fri Oct 11 16:51:13 2019 +0200
# Branch stable
# Node ID cdb5b5e5a88e55eddf78985a56e8da0e905e75d4
# Parent  597a90b8910cb8fe67307e538c72440e367d9c25
py3: fix setup.py --version

Before:

    $ python3 setup.py --version
    b'9.3.0.dev'

After:

    $ python3 setup.py --version
    9.3.0.dev

Patch

diff --git a/setup.py b/setup.py
index 4d2fab7..8c8980f 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@  def get_metadata():
 
 def get_version():
     '''Read version info from a file without importing it'''
-    return u'%s' % get_metadata()['__version__']
+    return get_metadata()['__version__'].decode()
 
 def min_hg_version():
     '''Read version info from a file without importing it'''