[X2Go-Commits] [x2goclient] 72/94: setup.py: backport Python 2 support via io.open.
git-admin at x2go.org
git-admin at x2go.org
Fri Dec 15 21:06:50 CET 2023
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to annotated tag 0.6.1.0
in repository x2goclient.
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 4f98e359..087f1d21 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 6376de78..878e68b6 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/x2goclient.git
More information about the x2go-commits
mailing list