Skip to content

Commit

Permalink
Merge pull request #481 from hectord/first_idea
Browse files Browse the repository at this point in the history
Remove non-ASCII characters from a critical exception's message
  • Loading branch information
gabrielfalcao committed Aug 27, 2015
2 parents 40c940d + de914ad commit 764456d
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 @@ -189,6 +189,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 764456d

Please sign in to comment.