]> git.pld-linux.org Git - packages/python-babel.git/commitdiff
Fix some failing tests
authorJacek Konieczny <jajcus@jajcus.net>
Mon, 30 Nov 2015 18:29:07 +0000 (19:29 +0100)
committerJacek Konieczny <jajcus@jajcus.net>
Mon, 30 Nov 2015 18:29:07 +0000 (19:29 +0100)
https://github.com/python-babel/babel/issues/133

python-babel.spec
tz.patch [new file with mode: 0644]

index 6758ef1a3a0a95de2d4972106e9a13d9dfd639aa..0a777612b916157a4e52dcda5d1febb1fe59a11f 100644 (file)
@@ -16,6 +16,7 @@ Group:                Development/Languages/Python
 #Source0Download: https://pypi.python.org/pypi/Babel
 Source0:       https://pypi.python.org/packages/source/B/Babel/Babel-%{version}.tar.gz
 # Source0-md5: cab63d158ceed3a809703711cfb8cbd5
+Patch0:                tz.patch
 URL:           http://babel.pocoo.org/
 %if %{with python2}
 BuildRequires: python-devel
@@ -79,6 +80,7 @@ Dokumentacja API biblioteki Pythona Babel.
 
 %prep
 %setup -q -n Babel-%{version}
+%patch0 -p1
 
 %build
 %if %{with python2}
diff --git a/tz.patch b/tz.patch
new file mode 100644 (file)
index 0000000..d6ac3c0
--- /dev/null
+++ b/tz.patch
@@ -0,0 +1,24 @@
+From 00e8526246ef292a5071303f25877fcf8c0a2dc8 Mon Sep 17 00:00:00 2001
+From: st4lk <myhappydo@gmail.com>
+Date: Mon, 26 Jan 2015 10:07:12 +0300
+Subject: [PATCH] apply fix #134 for babel issue #133
+
+---
+ babel/dates.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/babel/dates.py b/babel/dates.py
+index 73d54fa..a1b4cd7 100644
+--- a/babel/dates.py
++++ b/babel/dates.py
+@@ -308,7 +308,9 @@ def get_timezone_gmt(datetime=None, width='long', locale=LC_TIME):
+         datetime = datetime.replace(tzinfo=UTC)
+     locale = Locale.parse(locale)
+-    offset = datetime.tzinfo.utcoffset(datetime)
++    # fix for mitsuhiko/babel#133 : Any time will do since we just want the
++    # offset
++    offset = datetime.tzinfo.utcoffset(datetime_.utcnow())
+     seconds = offset.days * 24 * 60 * 60 + offset.seconds
+     hours, seconds = divmod(seconds, 3600)
+     if width == 'short':
This page took 0.068587 seconds and 4 git commands to generate.