Use exec directly

This commit is contained in:
Anthony Sottile
2019-05-06 23:07:39 -07:00
parent 6d259c400e
commit d1a48ad68f
9 changed files with 10 additions and 16 deletions

View File

@@ -7,7 +7,6 @@ import warnings
from decimal import Decimal
from numbers import Number
import six
from more_itertools.more import always_iterable
from six.moves import filterfalse
from six.moves import zip
@@ -702,7 +701,7 @@ def raises(expected_exception, *args, **kwargs):
# print "raises frame scope: %r" % frame.f_locals
try:
code = _pytest._code.Source(code).compile(_genframe=frame)
six.exec_(code, frame.f_globals, loc)
exec(code, frame.f_globals, loc)
# XXX didn't mean f_globals == f_locals something special?
# this is destroyed here ...
except expected_exception: