Skip to content

Commit

Permalink
Fix import cycle on 3.7/8
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Aug 5, 2024
1 parent daf46bd commit 043bab3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/attr/setters.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
Commonly used hooks for on_setattr.
"""


import attrs

from . import _config
from .exceptions import FrozenAttributeError

Expand Down Expand Up @@ -65,7 +62,10 @@ def convert(instance, attrib, new_value):
"""
c = attrib.converter
if c:
if not isinstance(c, attrs.Converter):
# This can be removed once we drop 3.8 and use attrs.Converter instead.
from ._make import Converter

if not isinstance(c, Converter):
return c(new_value)

return c(new_value, instance, attrib)
Expand Down

0 comments on commit 043bab3

Please sign in to comment.