[Python-checkins] cpython: Issue #15431: Declare PyImport_FrozenModules conditionally on Unix only.
martin.v.loewis
python-checkins at python.org
Sat Jul 28 21:55:52 CEST 2012
http://hg.python.org/cpython/rev/7967cb63e50e
changeset: 78309:7967cb63e50e
user: Martin v. Löwis <martin at v.loewis.de>
date: Sat Jul 28 21:55:20 2012 +0200
summary:
Issue #15431: Declare PyImport_FrozenModules conditionally on Unix only.
files:
Modules/_freeze_importlib.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/Modules/_freeze_importlib.c b/Modules/_freeze_importlib.c
--- a/Modules/_freeze_importlib.c
+++ b/Modules/_freeze_importlib.c
@@ -21,6 +21,13 @@
{0, 0, 0} /* sentinel */
};
+#ifndef MS_WINDOWS
+/* On Windows, this links with the regular pythonXY.dll, so this variable comes
+ from frozen.obj. In the Makefile, frozen.o is not linked into this executable,
+ so we define the variable here. */
+struct _frozen *PyImport_FrozenModules;
+#endif
+
const char header[] = "/* Auto-generated by Modules/_freeze_importlib.c */";
int
@@ -91,8 +98,8 @@
data_size = PyBytes_GET_SIZE(marshalled);
/* Open the file in text mode. The hg checkout should be using the eol extension,
- which in turn should cause the existing file to use CRLF */
- outfile = fopen(outpath, "wt");
+ which in turn should cause the EOL style match the C library's text mode */
+ outfile = fopen(outpath, "w");
if (outfile == NULL) {
fprintf(stderr, "cannot open '%s' for writing\n", outpath);
return 1;
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list