Rename signal handler argument to 'frame'

The object that is passed to signal handler functions is a frame object.
Traceback is the name of a built in module. Let's be clear.

Note that there are other places in the code where this unfortunate
naming happened, like in the keyword argument of the TextGuruMeditation
__init__ method. We can't really change that one as it's part of the
public API.

Change-Id: I11ca5cba3475a82a35c8e9fdb82e2529e5fa7b74
This commit is contained in:
Nikola Dipanov 2015-12-18 23:40:22 +00:00
parent 05f9345e05
commit 6681a45b6a
1 changed files with 5 additions and 5 deletions

View File

@ -153,11 +153,11 @@ class GuruMeditation(object):
@classmethod
def _setup_signal(cls, signum, version, service_name, log_dir):
signal.signal(signum,
lambda sn, tb: cls.handle_signal(
version, service_name, log_dir, tb))
lambda sn, f: cls.handle_signal(
version, service_name, log_dir, f))
@classmethod
def handle_signal(cls, version, service_name, log_dir, traceback):
def handle_signal(cls, version, service_name, log_dir, frame):
"""The Signal Handler
This method (indirectly) handles receiving a registered signal and
@ -172,11 +172,11 @@ class GuruMeditation(object):
:param version: the version object for the current product
:param service_name: this program name used to construct logfile name
:param logdir: path to a log directory where to create a file
:param traceback: the traceback provided to the signal handler
:param frame: the frame object provided to the signal handler
"""
try:
res = cls(version, traceback).run()
res = cls(version, frame).run()
except Exception:
print("Unable to run Guru Meditation Report!",
file=sys.stderr)