pytz/python-38-test.patch
Troy Dawson 1fe724d257 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/pytz#5aadaf7c66b5dd23da92dd027563674a0cfe6f30
2020-10-14 20:58:15 -07:00

17 lines
920 B
Diff

--- a/pytz/tests/test_tzinfo.py~ 2019-07-26 08:38:47.000000000 -0500
+++ b/pytz/tests/test_tzinfo.py 2019-07-26 08:40:12.751754602 -0500
@@ -184,8 +184,11 @@
# Python 3 introduced a new pickle protocol where numbers are stored in
# hexadecimal representation. Here we extract the pickle
# representation of the number for the current Python version.
- old_pickle_pattern = pickle.dumps(tz._utcoffset.seconds)[3:-1]
- new_pickle_pattern = pickle.dumps(new_utcoffset)[3:-1]
+ #
+ # Test protocol 3 on Python 3 and protocol 0 on Python 2.
+ protocol = (3 if sys.version_info >= (3,) else 0)
+ old_pickle_pattern = pickle.dumps(tz._utcoffset.seconds, protocol)[3:-1]
+ new_pickle_pattern = pickle.dumps(new_utcoffset, protocol)[3:-1]
hacked_p = p.replace(old_pickle_pattern, new_pickle_pattern)
self.assertNotEqual(p, hacked_p)