[X2Go-Commits] [pyhoca-cli] 01/02: setup.py: backport Python 2 support via io.open.

git-admin at x2go.org git-admin at x2go.org
Sat Nov 10 13:40:09 CET 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository pyhoca-cli.

commit 4f98092b4f933d4facfe26e1be9f5e19be6b256b
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sat Nov 10 13:35:57 2018 +0100

    setup.py: backport Python 2 support via io.open.
---
 debian/changelog | 1 +
 setup.py         | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 4f98e35..087f1d2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ pyhoca-cli (0.6.0.1-0x2go1) UNRELEASED; urgency=medium
 
   [ Mihai Moldovan ]
   * New upstream version (0.6.0.1):
+    - setup.py: backport Python 2 support via io.open.
   * pyhoca-cli.spec:
     - Build with Python 2 on CentOS, drop python3-argparse
       dependency (part of stdlib).
diff --git a/setup.py b/setup.py
index 6376de7..878e68b 100755
--- a/setup.py
+++ b/setup.py
@@ -22,6 +22,12 @@ import os
 
 from setuptools import setup
 
+# Specifying file encoding at open time only works with Python 3 directly,
+# but Python >2.6 has some support for this in the IO module.
+# It's said to be slow, but we can live with that.
+if sys.version_info[0] < 3:
+    from io import open
+
 __VERSION__ = "0.0.0.0"
 for line in open(os.path.join('pyhoca', 'cli', '__init__.py'),encoding='utf-8').readlines():
     if (line.startswith('__VERSION__')):

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pyhoca-cli.git


More information about the x2go-commits mailing list