Skip to content

Commit

Permalink
Fix PyPy2 build
Browse files Browse the repository at this point in the history
  • Loading branch information
movermeyer committed Oct 26, 2021
1 parent 0bb130f commit 3d91914
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# Unreleased

*
* Fix the build for PyPy2 ([#116](https://github.com/closeio/ciso8601/pull/116))

# 2.x.x

Expand Down
2 changes: 1 addition & 1 deletion module.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// https://foss.heptapod.net/pypy/pypy/-/merge_requests/826
#ifdef PYPY_VERSION
#define SUPPORTS_37_TIMEZONE_API \
(PYPY_VERSION_NUM >= 0x07030600)
(PYPY_VERSION_NUM >= 0x07030600) && PY_VERSION_AT_LEAST_37
#else
#define SUPPORTS_37_TIMEZONE_API \
PY_VERSION_AT_LEAST_37
Expand Down
5 changes: 3 additions & 2 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ def test_returns_built_in_utc_if_available(self):
# PyPy added support for it in 7.3.6

timestamp = '2018-01-01T00:00:00.00Z'
if (platform.python_implementation() == 'CPython' and sys.version_info >= (3, 7)) or \
(platform.python_implementation() == 'PyPy' and sys.pypy_version_info >= (7, 3, 6)):
if sys.version_info >= (3, 7) and \
(platform.python_implementation() == 'CPython'
or (platform.python_implementation() == 'PyPy' and sys.pypy_version_info >= (7, 3, 6))):
self.assertIs(parse_datetime(timestamp).tzinfo, datetime.timezone.utc)
else:
self.assertIsInstance(parse_datetime(timestamp).tzinfo, FixedOffset)
Expand Down

0 comments on commit 3d91914

Please sign in to comment.