From daadb52b9c244b5c35f5b7788a664f181d26b76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Sun, 31 Oct 2021 11:58:12 +0100 Subject: [PATCH] change print for python3 --- TODO.rst | 4 ++-- gitosis/gitweb.py | 8 +++++--- gitosis/ssh.py | 6 ++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/TODO.rst b/TODO.rst index 5874a9f..c749b8e 100644 --- a/TODO.rst +++ b/TODO.rst @@ -40,9 +40,9 @@ - can't trust "~":: - [0 tv@musti ~]$ sudo python -c 'import os; print os.path.expanduser("~")' + [0 tv@musti ~]$ sudo python -c 'import os; print(os.path.expanduser("~"))' /home/tv - [0 tv@musti ~]$ sudo -H python -c 'import os; print os.path.expanduser("~")' + [0 tv@musti ~]$ sudo -H python -c 'import os; print(os.path.expanduser("~"))' /root - command line options diff --git a/gitosis/gitweb.py b/gitosis/gitweb.py index 6d1cc67..19cf5ad 100644 --- a/gitosis/gitweb.py +++ b/gitosis/gitweb.py @@ -91,8 +91,9 @@ def generate_project_list_fp(config, fp): else: response.append(owner) - line = ' '.join([urllib.quote_plus(s) for s in response]) - print >>fp, line + line = ' '.join([urllib.parse.quote_plus(s) for s in response]) + #print >>fp, line + print(line, end="", file=fp) def generate_project_list(config, path): """ @@ -159,7 +160,8 @@ def set_descriptions(config): tmp = '%s.%d.tmp' % (path, os.getpid()) f = open(tmp, 'w') try: - print >>f, description + #print >>f, description + print(description, end="", file=f) finally: f.close() os.rename(tmp, path) diff --git a/gitosis/ssh.py b/gitosis/ssh.py index 45fbf0c..892f72c 100644 --- a/gitosis/ssh.py +++ b/gitosis/ssh.py @@ -76,11 +76,13 @@ def writeAuthorizedKeys(path, keydir): try: if in_ is not None: for line in filterAuthorizedKeys(in_): - print >>out, line + #print >>out, line + print(line, end="", file=out) keygen = readKeys(keydir) for line in generateAuthorizedKeys(keygen): - print >>out, line + #print >>out, line + print(line, end="", file=out) os.fsync(out) finally: