Skip to content

Commit

Permalink
Merge branch 'raise-from' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
koterpillar committed Aug 28, 2020
2 parents 3ddf4a7 + b461efe commit 2c5a940
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aloe/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def parse(cls, string=None, filename=None, language=None):
filename=filename,
)
except ParserError as ex:
raise AloeSyntaxError(filename, str(ex))
raise AloeSyntaxError(filename, str(ex)) from ex

@classmethod
def from_string(cls, string, language=None):
Expand Down
4 changes: 2 additions & 2 deletions aloe/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ def _assert_is_step(self, sentence, func):
except re.error as exc:
raise StepLoadingError("Error when trying to compile:\n"
" regex: %r\n"
" for function: %s\n"
" error: %s" % (sentence, func, exc))
" for function: %s" % (sentence, func)) \
from exc

def _attr_is_step(self, attr, obj):
"""Test whether an object's attribute is a step."""
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def run_feature(self, *args, **kwargs):
try:
import pty # pylint:disable=import-outside-toplevel
except ImportError:
raise unittest.SkipTest("PTY support unavailable.")
raise unittest.SkipTest("PTY support unavailable.") \
from None

chunks = [b'']

Expand Down

0 comments on commit 2c5a940

Please sign in to comment.