Skip to content

Commit

Permalink
Merge pull request #13 from benmaier/ulfaslak-patch-1
Browse files Browse the repository at this point in the history
Don't trigger `draw_netwulf` on KeyboardInterrupt
  • Loading branch information
ulfaslak committed Apr 10, 2019
2 parents f05e646 + 5162640 commit 6c52634
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions netwulf/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,11 @@ def visualize(network,
try:
while not server.end_requested:
time.sleep(0.1)
is_keyboard_interrupted = False
except KeyboardInterrupt:
is_keyboard_interrupted = True
pass

server.end_requested = True

if verbose:
Expand All @@ -299,10 +301,9 @@ def visualize(network,
# apparently this is how it has to be on Windows
is_jupyter = 'JPY_PARENT_PID' in env

if is_jupyter:
if is_jupyter and not is_keyboard_interrupted:
fig, ax = wulf.draw_netwulf(posted_network_properties)


return posted_network_properties, posted_config


Expand Down

0 comments on commit 6c52634

Please sign in to comment.