Skip to content

Commit cef371b

Browse files
committed
Use compat function for OS detection
and streamline OS detection functions return Signed-off-by: Justin Lecher <[email protected]>
1 parent 8c2e570 commit cef371b

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

pandas/compat/__init__.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -759,15 +759,12 @@ def __reduce__(self): # optional, for pickle support
759759

760760
# https://github.com/pydata/pandas/pull/9123
761761
def is_platform_windows():
762-
if sys.platform == 'win32' or sys.platform == 'cygwin':
763-
return True
762+
return sys.platform == 'win32' or sys.platform == 'cygwin'
764763

765764

766765
def is_platform_linux():
767-
if sys.platform == 'linux2':
768-
return True
766+
return sys.platform == 'linux2'
769767

770768

771769
def is_platform_mac():
772-
if sys.platform == 'darwin':
773-
return True
770+
return sys.platform == 'darwin'

pandas/tslib.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ from datetime import time as datetime_time
4141
# dateutil compat
4242
from dateutil.tz import (tzoffset, tzlocal as _dateutil_tzlocal, tzfile as _dateutil_tzfile,
4343
tzutc as _dateutil_tzutc)
44-
import sys
45-
if sys.platform != 'win32':
44+
from pandas.compat import is_platform_windows
45+
if is_platform_windows():
4646
from dateutil.tz import gettz as _dateutil_gettz
4747
else:
4848
from dateutil.zoneinfo import gettz as _dateutil_gettz

0 commit comments

Comments
 (0)