mirror of
https://github.com/curl/curl.git
synced 2026-08-24 15:33:37 +03:00
pytest: close file handles after use (cont.), and tidy-ups
- dante.py, dnsd.py, sshd.py: drop redundant conditions.
Spotted in sshd by GitHub Code Quality.
- curl.py: comment out `if` to silence CodeQL warning.
Reported by GitHub CodeQL
Follow-up to 8145476d5d #21916
Closes #21917
This commit is contained in:
parent
7b9d74abf6
commit
cb4465bfe6
9 changed files with 91 additions and 35 deletions
|
|
@ -114,10 +114,10 @@ class LocalClient:
|
|||
def dump_logs(self):
|
||||
lines = []
|
||||
lines.append('>>--stdout ----------------------------------------------\n')
|
||||
with open(self._stdoutfile) as cstdout:
|
||||
lines.extend(cstdout.readlines())
|
||||
with open(self._stdoutfile) as fd:
|
||||
lines.extend(fd.readlines())
|
||||
lines.append('>>--stderr ----------------------------------------------\n')
|
||||
with open(self._stderrfile) as cstderr:
|
||||
lines.extend(cstderr.readlines())
|
||||
with open(self._stderrfile) as fd:
|
||||
lines.extend(fd.readlines())
|
||||
lines.append('<<-------------------------------------------------------\n')
|
||||
return ''.join(lines)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue