Commit 0b3790ef authored by Jim Fulton's avatar Jim Fulton

Fixed dumb bug in __main__ fix. :-(

parent 440f71a8
/* /*
$Id: cPickle.c,v 1.40 1997/06/19 18:57:36 jim Exp $ $Id: cPickle.c,v 1.41 1997/06/20 19:45:10 jim Exp $
Copyright Copyright
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
static char cPickle_module_documentation[] = static char cPickle_module_documentation[] =
"C implementation and optimization of the Python pickle module\n" "C implementation and optimization of the Python pickle module\n"
"\n" "\n"
"$Id: cPickle.c,v 1.40 1997/06/19 18:57:36 jim Exp $\n" "$Id: cPickle.c,v 1.41 1997/06/20 19:45:10 jim Exp $\n"
; ;
#include "Python.h" #include "Python.h"
...@@ -667,14 +667,18 @@ whichmodule(PyObject *global, PyObject *global_name) { ...@@ -667,14 +667,18 @@ whichmodule(PyObject *global, PyObject *global_name) {
that used __main__ if no module is found. I don't actually that used __main__ if no module is found. I don't actually
like this rule. jlf like this rule. jlf
*/ */
if(!j) {
j=1; j=1;
name=__main___str; name=__main___str;
}
/*
if (!j) { if (!j) {
PyErr_Format(PicklingError, "Could not find module for %s.", PyErr_Format(PicklingError, "Could not find module for %s.",
"O", global_name); "O", global_name);
return NULL; return NULL;
} }
*/
PyDict_SetItem(class_map, global, name); PyDict_SetItem(class_map, global, name);
...@@ -3873,7 +3877,7 @@ init_stuff(PyObject *module, PyObject *module_dict) { ...@@ -3873,7 +3877,7 @@ init_stuff(PyObject *module, PyObject *module_dict) {
void void
initcPickle() { initcPickle() {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.40 $"; char *rev="$Revision: 1.41 $";
PyObject *format_version; PyObject *format_version;
PyObject *compatible_formats; PyObject *compatible_formats;
...@@ -3908,6 +3912,9 @@ initcPickle() { ...@@ -3908,6 +3912,9 @@ initcPickle() {
/**************************************************************************** /****************************************************************************
$Log: cPickle.c,v $ $Log: cPickle.c,v $
Revision 1.41 1997/06/20 19:45:10 jim
Fixed dumb bug in __main__ fix. :-(
Revision 1.40 1997/06/19 18:57:36 jim Revision 1.40 1997/06/19 18:57:36 jim
Added ident string. Added ident string.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment