Ansgar pushed to branch master at Debian FTP Team / dak
Commits:
2 changed files:
Changes:
... | ... | @@ -491,15 +491,11 @@ def output_deb_info(suite, filename, packagename, session=None): |
491 | 491 |
|
492 | 492 |
def do_command(command, escaped=False):
|
493 | 493 |
process = daklib.daksubprocess.Popen(command, stdout=subprocess.PIPE)
|
494 |
- o = process.stdout
|
|
495 |
- try:
|
|
496 |
- data = six.ensure_str(o.read())
|
|
497 |
- if escaped:
|
|
498 |
- return escaped_text(data)
|
|
499 |
- else:
|
|
500 |
- return formatted_text(data)
|
|
501 |
- finally:
|
|
502 |
- process.wait()
|
|
494 |
+ data = six.ensure_str(process.communicate()[0])
|
|
495 |
+ if escaped:
|
|
496 |
+ return escaped_text(data)
|
|
497 |
+ else:
|
|
498 |
+ return formatted_text(data)
|
|
503 | 499 |
|
504 | 500 |
|
505 | 501 |
def do_lintian(filename):
|
... | ... | @@ -103,11 +103,11 @@ def process_keyring(fullpath, secret=False): |
103 | 103 |
|
104 | 104 |
# Touch the file
|
105 | 105 |
print("Creating {} ...".format(fullpath))
|
106 |
- open(fullpath, 'w')
|
|
107 |
- if secret:
|
|
108 |
- os.chmod(fullpath, 0o600)
|
|
109 |
- else:
|
|
110 |
- os.chmod(fullpath, 0o644)
|
|
106 |
+ with open(fullpath, 'w') as fh:
|
|
107 |
+ if secret:
|
|
108 |
+ os.fchmod(fh.fileno(), 0o600)
|
|
109 |
+ else:
|
|
110 |
+ os.fchmod(fh.fileno(), 0o644)
|
|
111 | 111 |
|
112 | 112 |
######################################################################
|
113 | 113 |
|