[arch-commits] Commit in python2/trunk (2 files)

Stéphane Gaudreault stephane at archlinux.org
Wed Apr 13 16:35:25 UTC 2011


    Date: Wednesday, April 13, 2011 @ 12:35:24
  Author: stephane
Revision: 119684

upgpkg: python2 2.7.1-8
fix "import decimal" in the Turkish locale

Added:
  python2/trunk/python-2.7.1-fix-decimal-in-turkish-locale.patch
Modified:
  python2/trunk/PKGBUILD

--------------------------------------------------+
 PKGBUILD                                         |   12 +++--
 python-2.7.1-fix-decimal-in-turkish-locale.patch |   48 +++++++++++++++++++++
 2 files changed, 57 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-04-13 15:51:41 UTC (rev 119683)
+++ PKGBUILD	2011-04-13 16:35:24 UTC (rev 119684)
@@ -5,7 +5,7 @@
 
 pkgname=python2
 pkgver=2.7.1
-pkgrel=7
+pkgrel=8
 _pybasever=2.7
 pkgdesc="A high-level scripting language"
 arch=('i686' 'x86_64')
@@ -17,15 +17,21 @@
 conflicts=('python<3')
 options=('!makeflags')
 source=(http://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.bz2
-        python-2.7-db51.diff)
+        python-2.7-db51.diff
+        python-2.7.1-fix-decimal-in-turkish-locale.patch)
 md5sums=('aa27bc25725137ba155910bd8e5ddc4f'
-         'd9b8161568ce17a305c1b71e61ccd4b5')
+         'd9b8161568ce17a305c1b71e61ccd4b5'
+         '5032449f1ff2abfe18d14cc674165b23')
 
 build() {
   cd "${srcdir}/Python-${pkgver}"
 
   patch -Np1 -i ../python-2.7-db51.diff
 
+  # Fix "import decimal" in the Turkish locale
+  # cf : https://bugzilla.redhat.com/show_bug.cgi?id=694928
+  patch -Np1 -i ../python-2.7.1-fix-decimal-in-turkish-locale.patch
+
   # Temporary workaround for FS#22322
   # See http://bugs.python.org/issue10835 for upstream report
   sed -i "/progname =/s/python/python${_pybasever}/" Python/pythonrun.c

Added: python-2.7.1-fix-decimal-in-turkish-locale.patch
===================================================================
--- python-2.7.1-fix-decimal-in-turkish-locale.patch	                        (rev 0)
+++ python-2.7.1-fix-decimal-in-turkish-locale.patch	2011-04-13 16:35:24 UTC (rev 119684)
@@ -0,0 +1,48 @@
+diff -up Python-2.7.1/Lib/decimal.py.fix-decimal-in-turkish-locale Python-2.7.1/Lib/decimal.py
+--- Python-2.7.1/Lib/decimal.py.fix-decimal-in-turkish-locale	2010-07-08 17:22:54.000000000 -0400
++++ Python-2.7.1/Lib/decimal.py	2011-04-12 11:30:40.850350842 -0400
+@@ -1720,8 +1720,6 @@ class Decimal(object):
+         # here self was representable to begin with; return unchanged
+         return Decimal(self)
+
+-    _pick_rounding_function = {}
+-
+     # for each of the rounding functions below:
+     #   self is a finite, nonzero Decimal
+     #   prec is an integer satisfying 0 <= prec < len(self._int)
+@@ -1788,6 +1786,17 @@ class Decimal(object):
+         else:
+             return -self._round_down(prec)
+
++    _pick_rounding_function = dict(
++        ROUND_DOWN = '_round_down',
++        ROUND_UP = '_round_up',
++        ROUND_HALF_UP = '_round_half_up',
++        ROUND_HALF_DOWN = '_round_half_down',
++        ROUND_HALF_EVEN = '_round_half_even',
++        ROUND_CEILING = '_round_ceiling',
++        ROUND_FLOOR = '_round_floor',
++        ROUND_05UP = '_round_05up',
++    )
++
+     def fma(self, other, third, context=None):
+         """Fused multiply-add.
+
+@@ -3705,18 +3714,6 @@ _numbers.Number.register(Decimal)
+
+ ##### Context class #######################################################
+
+-
+-# get rounding method function:
+-rounding_functions = [name for name in Decimal.__dict__.keys()
+-                                    if name.startswith('_round_')]
+-for name in rounding_functions:
+-    # name is like _round_half_even, goes to the global ROUND_HALF_EVEN value.
+-    globalname = name[1:].upper()
+-    val = globals()[globalname]
+-    Decimal._pick_rounding_function[val] = name
+-
+-del name, val, globalname, rounding_functions
+-
+ class _ContextManager(object):
+     """Context manager class to support localcontext().




More information about the arch-commits mailing list