[Python-modules-commits] r17017 - in packages/pyke/trunk/debian (3 files)
eriol-guest at users.alioth.debian.org
eriol-guest at users.alioth.debian.org
Mon May 16 19:30:52 UTC 2011
Date: Monday, May 16, 2011 @ 19:30:35
Author: eriol-guest
Revision: 17017
Use string representation of float to fix doctest failure
in python2.7 due to shorter float repr feature.
Added:
packages/pyke/trunk/debian/patches/04_fix-shorter-float-repr.patch
Modified:
packages/pyke/trunk/debian/changelog
packages/pyke/trunk/debian/patches/series
Modified: packages/pyke/trunk/debian/changelog
===================================================================
--- packages/pyke/trunk/debian/changelog 2011-05-16 17:20:09 UTC (rev 17016)
+++ packages/pyke/trunk/debian/changelog 2011-05-16 19:30:35 UTC (rev 17017)
@@ -22,14 +22,17 @@
* debian/copyright
- Made DEP5 compliant
* debian/patches/01-fixed-hardcoded-path-in-doctest.patch
- - Changed a hardcoded path in a doctest to a path that is guaranteed
+ - Change a hardcoded path in a doctest to a path that is guaranteed
to exist on a POSIX system
* debian/patches/02_fix-insecure-temporary-file-use.patch
- - Used mktemp to create temporary file
+ - Use mktemp to create temporary file
* debian/patches/03_use-sed-instead-of-ed.patch
- - Used sed instead of ed to strip target links
+ - Use sed instead of ed to strip target links
+ * debian/patches/04_fix-shorter-float-repr.patch
+ - Use string representation of float to fix doctest failure
+ in python2.7
- -- Daniele Tricoli <eriol at mornie.org> Mon, 16 May 2011 04:14:42 +0200
+ -- Daniele Tricoli <eriol at mornie.org> Mon, 16 May 2011 20:35:22 +0200
pyke (1.1.1-1) unstable; urgency=low
Added: packages/pyke/trunk/debian/patches/04_fix-shorter-float-repr.patch
===================================================================
--- packages/pyke/trunk/debian/patches/04_fix-shorter-float-repr.patch (rev 0)
+++ packages/pyke/trunk/debian/patches/04_fix-shorter-float-repr.patch 2011-05-16 19:30:35 UTC (rev 17017)
@@ -0,0 +1,34 @@
+Use string representation of float to fix doctest failure in python2.7. str() is used instead of format() to support python2.5
+--- a/pyke/krb_compiler/scanner.py
++++ b/pyke/krb_compiler/scanner.py
+@@ -546,7 +546,10 @@
+ def __iter__(self): return self
+ def next(self):
+ t = lex.token()
+- if t: return t
++ if t:
++ if t.type == 'NUMBER_TOK' and isinstance(t.value, float):
++ t.value = str(t.value)
++ return t
+ raise StopIteration
+
+ def tokenize(s):
+@@ -594,12 +597,12 @@
+ LexToken(NUMBER_TOK,0,8,124)
+ LexToken(RP_TOK,')',8,125)
+ LexToken(NL_TOK,'\n',8,126)
+- LexToken(NUMBER_TOK,3.1400000000000001,9,129)
+- LexToken(NUMBER_TOK,0.98999999999999999,9,134)
+- LexToken(NUMBER_TOK,3.0,10,143)
+- LexToken(NUMBER_TOK,0.29999999999999999,10,146)
+- LexToken(NUMBER_TOK,3000000.0,10,149)
+- LexToken(NUMBER_TOK,3.0000000000000001e-06,10,153)
++ LexToken(NUMBER_TOK,'3.14',9,129)
++ LexToken(NUMBER_TOK,'0.99',9,134)
++ LexToken(NUMBER_TOK,'3.0',10,143)
++ LexToken(NUMBER_TOK,'0.3',10,146)
++ LexToken(NUMBER_TOK,'3000000.0',10,149)
++ LexToken(NUMBER_TOK,'3e-06',10,153)
+ LexToken(NL_TOK,'\n',10,158)
+ LexToken(DEINDENT_TOK,'\n ',11,158)
+ LexToken(ASSERT_TOK,'assert',11,163)
Modified: packages/pyke/trunk/debian/patches/series
===================================================================
--- packages/pyke/trunk/debian/patches/series 2011-05-16 17:20:09 UTC (rev 17016)
+++ packages/pyke/trunk/debian/patches/series 2011-05-16 19:30:35 UTC (rev 17017)
@@ -1,3 +1,4 @@
01_fix-hardcoded-path-in-doctest.patch
02_fix-insecure-temporary-file-use.patch
03_use-sed-instead-of-ed.patch
+04_fix-shorter-float-repr.patch
More information about the Python-modules-commits
mailing list