Fix unicode attribute error if typing installed on py2.7 (#363)
This commit is contained in:
committed by
Cristi Vîjdea
parent
91ef83e830
commit
b5aba7243d
@@ -1,3 +1,5 @@
|
||||
import sys
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from rest_framework import serializers
|
||||
|
||||
@@ -6,7 +8,10 @@ from snippets.models import Snippet
|
||||
|
||||
try:
|
||||
import typing # noqa: F401
|
||||
from .method_serializers_with_typing import MethodFieldExampleSerializer
|
||||
if sys.version_info >= (3, 4):
|
||||
from .method_serializers_with_typing import MethodFieldExampleSerializer
|
||||
else:
|
||||
from .method_serializers_without_typing import MethodFieldExampleSerializer
|
||||
except ImportError:
|
||||
from .method_serializers_without_typing import MethodFieldExampleSerializer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user