Skip to content

Commit

Permalink
Use documented os.sep instead of os.path.sep
Browse files Browse the repository at this point in the history
Fixes #72
  • Loading branch information
stub42 committed May 8, 2022
1 parent bd7b528 commit 14f33bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pytz/__init__.py
Expand Up @@ -86,7 +86,7 @@ def open_resource(name):
"""
name_parts = name.lstrip('/').split('/')
for part in name_parts:
if part == os.path.pardir or os.path.sep in part:
if part == os.path.pardir or os.sep in part:
raise ValueError('Bad path segment: %r' % part)
zoneinfo_dir = os.environ.get('PYTZ_TZDATADIR', None)
if zoneinfo_dir is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/setup.py
Expand Up @@ -17,7 +17,7 @@
resources = ['zone.tab', 'locales/pytz.pot']
for dirpath, dirnames, filenames in os.walk(os.path.join('pytz', 'zoneinfo')):
# remove the 'pytz' part of the path
basepath = dirpath.split(os.path.sep, 1)[1]
basepath = dirpath.split(os.sep, 1)[1]
resources.extend([os.path.join(basepath, filename) for filename in filenames])
package_data = {'pytz': resources}

Expand Down

0 comments on commit 14f33bf

Please sign in to comment.