Minor python3 compatible tweaks

Slightly reduces the changes from 2to3 while remaining python2
compatible.
Signed-off-by: NNiels Thykier <niels@thykier.net>
上级 4c4ee6e9
......@@ -196,7 +196,7 @@ def main():
else:
raw_input("Press Enter to continue")
for acceptfilename in acceptfiles.keys():
for acceptfilename in acceptfiles:
accept_file = open(acceptfilename, "w")
accept_file.write("OK\n")
accept_file.close()
......
......@@ -552,13 +552,11 @@ def find_next_free(dest, too_many=100):
def result_join(original, sep='\t'):
resultlist = []
for i in xrange(len(original)):
if original[i] is None:
resultlist.append("")
else:
resultlist.append(original[i])
return sep.join(resultlist)
return sep.join(
x if x is not None else ""
for x in original
)
################################################################################
......@@ -951,7 +949,7 @@ def parse_wnpp_bug_file(file="/srv/ftp-master.debian.org/scripts/masterfiles/wnp
if len(splited_line) > 1:
wnpp[splited_line[0]] = splited_line[1].split("|")
for source in wnpp.keys():
for source in wnpp:
bugs = []
for wnpp_bug in wnpp[source]:
bug_no = re.search(r"(\d)+", wnpp_bug).group()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册