Skip to content

Commit

Permalink
Revert "Py3 exception logging, issue #17"
Browse files Browse the repository at this point in the history
This reverts commit ef6dd58.
  • Loading branch information
lusitania committed Oct 5, 2014
1 parent ef6dd58 commit 2a11ea0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion airbrake/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def airbrake_error_from_logrecord(record):
# find params from kwarg 'extra'
# See "The second keyword argument is extra"
# - https://docs.python.org/2/library/logging.html#logging.Logger.debug
for key, val in list(vars(record).items()):
for key, val in vars(record).items():
if not hasattr(_FAKE_LOGRECORD, key):
# handle attribute/field name collisions:
# logrecod attrs should not limit or take
Expand Down
12 changes: 3 additions & 9 deletions airbrake/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@

import traceback
import types
import sys

if sys.version_info < (3,):
#Py2 legacy fix
type_of_type = types.TypeType
else:
type_of_type = type

class CheckableQueue(Queue):

Expand Down Expand Up @@ -48,9 +42,9 @@ def is_exc_info_tuple(exc_info):
"""
try:
errtype, value, tback = exc_info
if all([x is None for x in exc_info]):
if all(map(lambda x: x is None, exc_info)):
return True
elif all((isinstance(errtype, type_of_type),
elif all((isinstance(errtype, types.TypeType),
isinstance(value, Exception),
isinstance(tback, types.TracebackType))):
return True
Expand Down Expand Up @@ -98,6 +92,6 @@ def pytb_lastline(excinfo=None):
# strip whitespace, Falsy values,
# and the string 'None', sometimes returned by the traceback module
lines = [line.strip() for line in lines if line]
lines = [line for line in lines if str(line).lower() != 'none']
lines = filter(lambda line: str(line).lower() != 'none', lines)
if lines:
return lines[-1]

0 comments on commit 2a11ea0

Please sign in to comment.