[Thuban-commits] r2708 - in trunk/thuban: . Thuban/Model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Sep 24 22:01:24 CEST 2006


Author: bernhard
Date: 2006-09-24 22:01:23 +0200 (Sun, 24 Sep 2006)
New Revision: 2708

Modified:
   trunk/thuban/ChangeLog
   trunk/thuban/Thuban/Model/proj.py
Log:
* Thuban/Model/proj.py(_do_we_have_to_work_around_broken_proj): 
Making the test more robust for observed python 2.3 problems
with setlocale().


Modified: trunk/thuban/ChangeLog
===================================================================
--- trunk/thuban/ChangeLog	2006-09-24 19:33:48 UTC (rev 2707)
+++ trunk/thuban/ChangeLog	2006-09-24 20:01:23 UTC (rev 2708)
@@ -1,5 +1,9 @@
 2006-09-24 Bernhard Reiter <bernhard at intevation.de>
 
+	* Thuban/Model/proj.py(_do_we_have_to_work_around_broken_proj): 
+	Making the test more robust for observed python 2.3 problems
+	with setlocale().
+
 	* test/runtests.py: Added new option ---setdecimalcommalocale
    	to run all tests with an LC_NUMERIC that uses comma as decimal_point.
 	Minor: Added (c) year 2006. Fixed typo in a docstring.

Modified: trunk/thuban/Thuban/Model/proj.py
===================================================================
--- trunk/thuban/Thuban/Model/proj.py	2006-09-24 19:33:48 UTC (rev 2707)
+++ trunk/thuban/Thuban/Model/proj.py	2006-09-24 20:01:23 UTC (rev 2708)
@@ -35,7 +35,13 @@
         proj = BaseProjection(params)
         result2 = proj.Forward(1,1)
 
-        locale.setlocale(locale.LC_NUMERIC, savedlocale)
+        try:
+            locale.setlocale(locale.LC_NUMERIC, savedlocale)
+        except:
+            # python under some circumstances (observed 2.3.5-2 Debian Sarge)
+            # does not accept savedlocale directly 
+            # deviating from the documentation
+            locale.setlocale(locale.LC_NUMERIC, savedlocale[0])
         if result1 != result2:
             return True
     return False



More information about the Thuban-commits mailing list