Skip to content

Commit

Permalink
Get rid of get_tzinfo_options() altogether
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Feb 22, 2024
1 parent 070f3e5 commit 94db19c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
15 changes: 0 additions & 15 deletions botocore/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

from botocore.vendored import six
from botocore.exceptions import MD5UnavailableError
from dateutil.tz import tzlocal
from urllib3 import exceptions

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -273,20 +272,6 @@ def _windows_shell_split(s):
return components


def get_tzinfo_options():
# This function is not used internally anymore.

# Due to dateutil/dateutil#197, Windows may fail to parse times in the past
# with the system clock. We can alternatively fallback to tzwininfo when
# this happens, which will get time info from the Windows registry.
if sys.platform == 'win32':
from dateutil.tz import tzwinlocal

return (tzlocal, tzwinlocal)
else:
return (tzlocal,)


# Detect if CRT is available for use
try:
import awscrt.auth
Expand Down
10 changes: 0 additions & 10 deletions tests/unit/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
compat_shell_split,
ensure_bytes,
get_md5,
get_tzinfo_options,
total_seconds,
unquote_str,
)
Expand Down Expand Up @@ -208,15 +207,6 @@ def assert_raises(self, s, exception_cls, platform):
compat_shell_split(s, platform)


class TestTimezoneOperations(unittest.TestCase):
def test_get_tzinfo_options(self):
options = get_tzinfo_options()
self.assertTrue(len(options) > 0)

for tzinfo in options:
self.assertIsInstance(tzinfo(), datetime.tzinfo)


class TestCRTIntegration(unittest.TestCase):
def test_has_crt_global(self):
try:
Expand Down

0 comments on commit 94db19c

Please sign in to comment.