Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/attr/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ def isclass(klass):
# TYPE is used in exceptions, repr(int) is different on Python 2 and 3.
TYPE = "type"

def exec_(code, locals_, globals_):
exec("exec code in locals_, globals_")

def iteritems(d):
return d.iteritems()

Expand All @@ -31,9 +28,6 @@ def isclass(klass):

TYPE = "class"

def exec_(code, locals_, globals_):
exec(code, locals_, globals_)

def iteritems(d):
return d.items()

Expand Down
4 changes: 2 additions & 2 deletions src/attr/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import linecache

from . import _config
from ._compat import exec_, iteritems, isclass, iterkeys
from ._compat import iteritems, isclass, iterkeys
from .exceptions import FrozenInstanceError

# This is used at least twice, so cache it here.
Expand Down Expand Up @@ -418,7 +418,7 @@ def _add_init(cls, frozen):
# Save the lookup overhead in __init__ if we need to circumvent
# immutability.
globs["_cached_setattr"] = _obj_setattr
exec_(bytecode, globs, locs)
eval(bytecode, globs, locs)
init = locs["__init__"]

# In order of debuggers like PDB being able to step through the code,
Expand Down