Skip to content

Commit bfb2e61

Browse files
Remove unnecessary six usage. Address Django 5.0 breaking change. Fixes #36. (#37)
Co-authored-by: James Addison <[email protected]>
1 parent 1b3687c commit bfb2e61

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ninja_jwt/utils.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66

77
from django.conf import settings
88
from django.utils.functional import lazy
9-
from django.utils.timezone import is_naive, make_aware, utc
10-
from six import string_types
9+
from django.utils.timezone import is_naive, make_aware
1110

1211
from ninja_jwt import exceptions
1312

13+
try:
14+
from datetime.timezone import utc
15+
except ImportError:
16+
from django.utils.timezone import utc
17+
18+
1419
logger = logging.getLogger("django")
1520

1621

@@ -32,7 +37,7 @@ def import_callable(path_or_callable):
3237
if callable(path_or_callable):
3338
return path_or_callable
3439
else:
35-
assert isinstance(path_or_callable, string_types)
40+
assert isinstance(path_or_callable, str)
3641
package, attr = path_or_callable.rsplit(".", 1)
3742
packages = import_module(package)
3843
return getattr(packages, attr)

0 commit comments

Comments
 (0)