Skip to content

Commit

Permalink
Remove non-ASCII characters from a critical exception's message
Browse files Browse the repository at this point in the history
  • Loading branch information
hectord committed Jun 1, 2015
1 parent 19e6f8c commit 28edfda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lettuce/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ def run(self):
except exceptions.LettuceSyntaxError, e:
sys.stderr.write(e.msg)
failed = True
except exceptions.NoDefinitionFound, e:
sys.stderr.write(e.msg)
failed = True
except:
if not self.failfast:
e = sys.exc_info()[1]
Expand Down
7 changes: 5 additions & 2 deletions lettuce/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ class NoDefinitionFound(Exception):
"""
def __init__(self, step):
self.step = step
super(NoDefinitionFound, self).__init__(
'The step r"%s" is not defined' % self.step.sentence)

error = filter(lambda x : 0 <= ord(x) <= 127,
'The step r"%s" is not defined' % self.step.sentence)
super(NoDefinitionFound, self).__init__(error)



class ReasonToFail(object):
Expand Down

0 comments on commit 28edfda

Please sign in to comment.