change print for python3

This commit is contained in:
Jakobus Schürz 2021-10-31 11:58:12 +01:00
parent a6205344b1
commit daadb52b9c
3 changed files with 11 additions and 7 deletions

View file

@ -40,9 +40,9 @@
- can't trust "~":: - 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 /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 /root
- command line options - command line options

View file

@ -91,8 +91,9 @@ def generate_project_list_fp(config, fp):
else: else:
response.append(owner) response.append(owner)
line = ' '.join([urllib.quote_plus(s) for s in response]) line = ' '.join([urllib.parse.quote_plus(s) for s in response])
print >>fp, line #print >>fp, line
print(line, end="", file=fp)
def generate_project_list(config, path): def generate_project_list(config, path):
""" """
@ -159,7 +160,8 @@ def set_descriptions(config):
tmp = '%s.%d.tmp' % (path, os.getpid()) tmp = '%s.%d.tmp' % (path, os.getpid())
f = open(tmp, 'w') f = open(tmp, 'w')
try: try:
print >>f, description #print >>f, description
print(description, end="", file=f)
finally: finally:
f.close() f.close()
os.rename(tmp, path) os.rename(tmp, path)

View file

@ -76,11 +76,13 @@ def writeAuthorizedKeys(path, keydir):
try: try:
if in_ is not None: if in_ is not None:
for line in filterAuthorizedKeys(in_): for line in filterAuthorizedKeys(in_):
print >>out, line #print >>out, line
print(line, end="", file=out)
keygen = readKeys(keydir) keygen = readKeys(keydir)
for line in generateAuthorizedKeys(keygen): for line in generateAuthorizedKeys(keygen):
print >>out, line #print >>out, line
print(line, end="", file=out)
os.fsync(out) os.fsync(out)
finally: finally: