  from django.utils.encoding import is_protected_type, smart_str
  from django.utils.formats import localize_input, sanitize_separators
  from django.utils.ipv6 import clean_ipv6_address
  from django.utils.translation import gettext_lazy as _
  from pytz.exceptions import InvalidTimeError
  
  from rest_framework import ISO_8601
  from rest_framework.exceptions import ErrorDetail, ValidationError
  from rest_framework.settings import api_settings
  from rest_framework.utils import html, humanize_datetime, json, representation
 
</s> remove import pytz
 </s> add try:
    import pytz
except ImportError:
    pytz = None
 </s> remove             except InvalidTimeError:
                self.fail('make_aware', timezone=field_timezone)
 </s> add             except Exception as e:
                if pytz and isinstance(e, pytz.exceptions.InvalidTimeError):
                    self.fail('make_aware', timezone=field_timezone)
                raise e </s> remove     field = serializers.DateTimeField(default_timezone=MockTimezone())
 </s> add         field = serializers.DateTimeField(default_timezone=MockTimezone()) </s> remove         def __str__(self):
            return 'America/New_York'
 </s> add             def __str__(self):
                return 'America/New_York' </s> remove     class MockTimezone(pytz.BaseTzInfo):
        @staticmethod
        def localize(value, is_dst):
            raise pytz.InvalidTimeError()
 </s> add     if pytz:
        class MockTimezone(pytz.BaseTzInfo):
            @staticmethod
            def localize(value, is_dst):
                raise pytz.InvalidTimeError()
try:
    import pytz
except ImportError:
    pytz = None
  from django.utils.encoding import is_protected_type, smart_str
  from django.utils.formats import localize_input, sanitize_separators
  from django.utils.ipv6 import clean_ipv6_address
  from django.utils.translation import gettext_lazy as _
try:
    import pytz
except ImportError:
    pytz = None
  
  from rest_framework import ISO_8601
  from rest_framework.exceptions import ErrorDetail, ValidationError
  from rest_framework.settings import api_settings
  from rest_framework.utils import html, humanize_datetime, json, representation
keep keep keep keep replace keep keep keep keep keep
 remove dependency on pytz (#8984)

* remove pytz

* Revert "remove pytz"

This reverts commit 393609dfaadbc4d82f760e6e4df8a6de6de24f9b.

* remove pytz, more subtly 
rest_framework/fields.py