commit cea56a338b38a8c30f39da6b65f72e49c006fb5b Author: Elan Ruusamäe <g...@delfi.ee> Date: Mon Oct 17 23:45:40 2016 +0300
up to 2016.7 (2016g) zoneinfo.patch | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) --- diff --git a/zoneinfo.patch b/zoneinfo.patch index 03231bd..22b62d0 100644 --- a/zoneinfo.patch +++ b/zoneinfo.patch @@ -1,8 +1,8 @@ ---- pytz-2013d/pytz/__init__.py.orig 2013-09-15 18:04:41.913643693 +0200 -+++ pytz-2013d/pytz/__init__.py 2013-09-15 18:06:35.450305595 +0200 -@@ -77,24 +77,19 @@ +--- pytz-2016.7/pytz/__init__.py~ 2016-10-17 23:41:37.000000000 +0300 ++++ pytz-2016.7/pytz/__init__.py 2016-10-17 23:44:26.782524661 +0300 +@@ -70,30 +70,18 @@ """ - return s.encode('US-ASCII') + return s.encode('ASCII') +_tzinfo_dir = os.getenv("TZDIR") or "/usr/share/zoneinfo" +if _tzinfo_dir.endswith(os.sep): @@ -10,7 +10,7 @@ def open_resource(name): """Open a resource from the zoneinfo subdir for reading. - +- - Uses the pkg_resources module if available and no standard file - found at the calculated location. """ @@ -20,11 +20,17 @@ raise ValueError('Bad path segment: %r' % part) - filename = os.path.join(os.path.dirname(__file__), - 'zoneinfo', *name_parts) -- if not os.path.exists(filename) and resource_stream is not None: +- if not os.path.exists(filename): - # http://bugs.launchpad.net/bugs/383171 - we avoid using this - # unless absolutely necessary to help when a broken version of - # pkg_resources is installed. -- return resource_stream(__name__, 'zoneinfo/' + name) +- try: +- from pkg_resources import resource_stream +- except ImportError: +- resource_stream = None +- +- if resource_stream is not None: +- return resource_stream(__name__, 'zoneinfo/' + name) + filename = os.path.join(_tzinfo_dir, *name_parts) return open(filename, 'rb') ================================================================ ---- gitweb: http://git.pld-linux.org/gitweb.cgi/packages/python-pytz.git/commitdiff/fa19a5fc1f8f382ca6fee37490b0473c50406acf _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit