Skip to content

Commit

Permalink
Merge pull request #516 from cool-RR/patch-1
Browse files Browse the repository at this point in the history
Fix exception causes in zmqshell.py
  • Loading branch information
blink1073 authored Jun 12, 2020
2 parents c87ce69 + 5c24134 commit 8ec2c46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ipykernel/zmqshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ def autosave(self, arg_s):

try:
interval = int(arg_s)
except ValueError:
raise UsageError("%%autosave requires an integer, got %r" % arg_s)
except ValueError as e:
raise UsageError("%%autosave requires an integer, got %r" % arg_s) from e

# javascript wants milliseconds
milliseconds = 1000 * interval
Expand Down Expand Up @@ -485,7 +485,7 @@ def enable_gui(self, gui):
real_enable_gui(gui)
self.active_eventloop = gui
except ValueError as e:
raise UsageError("%s" % e)
raise UsageError("%s" % e) from e

def init_environment(self):
"""Configure the user's environment."""
Expand Down

0 comments on commit 8ec2c46

Please sign in to comment.