Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b42dab5

Browse files
committed
Merged revisions 75441 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ................ r75441 | mark.dickinson | 2009-10-15 20:55:18 +0100 (Thu, 15 Oct 2009) | 9 lines Merged revisions 75440 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r75440 | mark.dickinson | 2009-10-15 18:45:39 +0100 (Thu, 15 Oct 2009) | 1 line Allow core Python build to succeed under WITHOUT_COMPLEX. The module build stage still fails. ........ ................
1 parent 85df26f commit b42dab5

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Python/compile.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,10 +909,8 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
909909
{
910910
PyObject *t, *v;
911911
Py_ssize_t arg;
912-
unsigned char *p, *q;
913-
Py_complex z;
912+
unsigned char *p;
914913
double d;
915-
int real_part_zero, imag_part_zero;
916914

917915
/* necessary to make sure types aren't coerced (e.g., int and long) */
918916
/* _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms */
@@ -927,7 +925,11 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
927925
else
928926
t = PyTuple_Pack(2, o, o->ob_type);
929927
}
928+
#ifndef WITHOUT_COMPLEX
930929
else if (PyComplex_Check(o)) {
930+
Py_complex z;
931+
int real_part_zero, imag_part_zero;
932+
unsigned char *q;
931933
/* complex case is even messier: we need to make complex(x,
932934
0.) different from complex(x, -0.) and complex(0., y)
933935
different from complex(-0., y), for any x and y. In
@@ -957,6 +959,7 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
957959
t = PyTuple_Pack(2, o, o->ob_type);
958960
}
959961
}
962+
#endif /* WITHOUT_COMPLEX */
960963
else {
961964
t = PyTuple_Pack(2, o, o->ob_type);
962965
}

Python/formatter_unicode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#define FORMAT_STRING _PyUnicode_FormatAdvanced
1010
#define FORMAT_LONG _PyLong_FormatAdvanced
1111
#define FORMAT_FLOAT _PyFloat_FormatAdvanced
12+
#ifndef WITHOUT_COMPLEX
1213
#define FORMAT_COMPLEX _PyComplex_FormatAdvanced
14+
#endif
1315

1416
#include "../Objects/stringlib/formatter.h"

0 commit comments

Comments
 (0)