From: Stefan Behnel Date: Wed, 11 Dec 2013 21:00:54 +0000 (+0100) Subject: tweak order of constant generation a bit X-Git-Tag: 0.20b1~119 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2c5c9fc4052aa7a3f9cf088e0c6bafaf2f4ff87;p=platform%2Fupstream%2Fpython-cython.git tweak order of constant generation a bit --- diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py index 37dd62b..ed8c0c9 100644 --- a/Cython/Compiler/Code.py +++ b/Cython/Compiler/Code.py @@ -1258,12 +1258,12 @@ class GlobalState(object): init_globals.error_goto(self.module_pos))) def generate_num_constants(self): - consts = [(c.py_type, len(c.value), c.value, c.value_code, c) + consts = [(c.py_type, c.value[0] == '-', len(c.value), c.value, c.value_code, c) for c in self.num_const_index.values()] consts.sort() decls_writer = self.parts['decls'] init_globals = self.parts['init_globals'] - for py_type, _, value, value_code, c in consts: + for py_type, _, _, value, value_code, c in consts: cname = c.cname decls_writer.putln("static PyObject *%s;" % cname) if py_type == 'float':