mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-30 16:13:58 +00:00
Try to update to Python 3.
This commit is contained in:
parent
d54294a6ec
commit
77e7f80a1a
@ -26,10 +26,10 @@ python run-deprecations.py [--warnings=STDERRFILE] [--package=PYTHONPACKAGE ] CO
|
|||||||
class RunPP(protocol.ProcessProtocol):
|
class RunPP(protocol.ProcessProtocol):
|
||||||
def outReceived(self, data):
|
def outReceived(self, data):
|
||||||
self.stdout.write(data)
|
self.stdout.write(data)
|
||||||
sys.stdout.write(data)
|
sys.stdout.write(str(data, sys.stdout.encoding))
|
||||||
def errReceived(self, data):
|
def errReceived(self, data):
|
||||||
self.stderr.write(data)
|
self.stderr.write(data)
|
||||||
sys.stderr.write(data)
|
sys.stderr.write(str(data, sys.stdout.encoding))
|
||||||
def processEnded(self, reason):
|
def processEnded(self, reason):
|
||||||
signal = reason.value.signal
|
signal = reason.value.signal
|
||||||
rc = reason.value.exitCode
|
rc = reason.value.exitCode
|
||||||
@ -100,17 +100,19 @@ def run_command(main):
|
|||||||
|
|
||||||
pp.stdout.seek(0)
|
pp.stdout.seek(0)
|
||||||
for line in pp.stdout.readlines():
|
for line in pp.stdout.readlines():
|
||||||
|
line = str(line, sys.stdout.encoding)
|
||||||
if match(line):
|
if match(line):
|
||||||
add(line) # includes newline
|
add(line) # includes newline
|
||||||
|
|
||||||
pp.stderr.seek(0)
|
pp.stderr.seek(0)
|
||||||
for line in pp.stderr.readlines():
|
for line in pp.stderr.readlines():
|
||||||
|
line = str(line, sys.stdout.encoding)
|
||||||
if match(line):
|
if match(line):
|
||||||
add(line)
|
add(line)
|
||||||
|
|
||||||
if warnings:
|
if warnings:
|
||||||
if config["warnings"]:
|
if config["warnings"]:
|
||||||
with open(config["warnings"], "wb") as f:
|
with open(config["warnings"], "w") as f:
|
||||||
print("".join(warnings), file=f)
|
print("".join(warnings), file=f)
|
||||||
print("ERROR: %d deprecation warnings found" % len(warnings))
|
print("ERROR: %d deprecation warnings found" % len(warnings))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user