Skip to content

Commit

Permalink
Merge pull request #115 from sanga/fix_traceback
Browse files Browse the repository at this point in the history
fix module and variable name clash (traceback refers to a mod so it's a ...
  • Loading branch information
heyman committed Dec 3, 2013
2 parents e215516 + 32f2766 commit 8c99d53
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion locust/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def run(self, *args, **kwargs):
except GreenletExit:
raise
except Exception as e:
events.locust_error.fire(locust_instance=self, exception=e, traceback=sys.exc_info()[2])
events.locust_error.fire(locust_instance=self, exception=e, tb=sys.exc_info()[2])
sys.stderr.write("\n" + traceback.format_exc())
self.wait()

Expand Down
2 changes: 1 addition & 1 deletion locust/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def fire(self, **kwargs):
* *locust_instance*: Locust class instance where the exception occurred
* *exception*: Exception that was thrown
* *traceback*: Traceback object (from sys.exc_info()[2])
* *tb*: Traceback object (from sys.exc_info()[2])
"""

report_to_master = EventHook()
Expand Down
8 changes: 4 additions & 4 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def __init__(self, locust_classes, options):
super(LocalLocustRunner, self).__init__(locust_classes, options)

# register listener thats logs the exception for the local runner
def on_locust_error(locust_instance, exeption, traceback):
formatted_tb = "".join(traceback.format_tb(traceback))
def on_locust_error(locust_instance, exeption, tb):
formatted_tb = "".join(traceback.format_tb(tb))
self.log_exception("local", str(exception), formatted_tb)
events.locust_error += on_locust_error

Expand Down Expand Up @@ -373,8 +373,8 @@ def on_quitting():
events.quitting += on_quitting

# register listener thats sends locust exceptions to master
def on_locust_error(locust_instance, exception, traceback):
formatted_tb = "".join(traceback.format_tb(traceback))
def on_locust_error(locust_instance, exception, tb):
formatted_tb = "".join(traceback.format_tb(tb))
self.client.send(Message("exception", {"msg" : str(exception), "traceback" : formatted_tb}, self.client_id))
events.locust_error += on_locust_error

Expand Down

0 comments on commit 8c99d53

Please sign in to comment.