Skip to content

Commit

Permalink
Possibly I fixed a really stupid bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ceriottm committed Nov 16, 2023
1 parent 0a58d41 commit 76b80a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion ipi/engine/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ def close_stream(self):
try:
if hasattr(self.out, "__getitem__"):
for o in self.out:
o.close()
if o is not None:
o.close()
else:
self.out.close()
except AttributeError:
Expand Down
13 changes: 8 additions & 5 deletions ipi_tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,15 @@ def run(self, cwd, nid):
assert ipi.returncode == 0, "i-PI error occurred: {}".format(ipi_error)

except sp.TimeoutExpired:


ipi.kill()
try:
ipi_out, ipi_error = ipi.communicate(timeout=2)
except:
ipi_out, ipi_error = "", "Could not get outputs from ipi"
pass

drivers[0].kill()
try:
driver_out, driver_err = drivers[0].communicate(timeout=2)
except:
Expand All @@ -373,11 +376,11 @@ def run(self, cwd, nid):

print("Timeout during {} test \
**** i-PI output **** \
Error {} \
Output {} \
stdout {} \
stderr {} \
**** driver output **** \
Error {} \
Output {} \
stdout {} \
stderr {} \
".format(
str(cwd),
ipi_out, ipi_error,
Expand Down

0 comments on commit 76b80a8

Please sign in to comment.