summaryrefslogtreecommitdiffstats
path: root/Include/cStringIO.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-08-13 03:14:41 (GMT)
committerGuido van Rossum <guido@python.org>1997-08-13 03:14:41 (GMT)
commit142eeb8339e4f3bcf40765377a1856bcc9a5ea66 (patch)
tree928df59f7314935ceab5071fe0fc9fc2363865b4 /Include/cStringIO.h
parentf55afae3c6999779a75af6236f947a663af9db65 (diff)
downloadcpython-142eeb8339e4f3bcf40765377a1856bcc9a5ea66.zip
cpython-142eeb8339e4f3bcf40765377a1856bcc9a5ea66.tar.gz
cpython-142eeb8339e4f3bcf40765377a1856bcc9a5ea66.tar.bz2
cPickle release 0.3 from Jim Fulton
Diffstat (limited to 'Include/cStringIO.h')
-rw-r--r--Include/cStringIO.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/Include/cStringIO.h b/Include/cStringIO.h
index 632177e..ceb9c16 100644
--- a/Include/cStringIO.h
+++ b/Include/cStringIO.h
@@ -70,12 +70,12 @@
This would typically be done in your init function.
$Log$
- Revision 2.4 1997/04/09 18:04:08 guido
- Got rid of the static decl of PyCObject_Import, which was a 1.4
- compatibility hack.
+ Revision 2.5 1997/08/13 03:14:08 guido
+ cPickle release 0.3 from Jim Fulton
- Revision 2.3 1997/04/09 17:34:28 guido
- Changed the way the C API was exported. Jim Fulton.
+ Revision 1.3 1997/06/13 19:44:02 jim
+ - changed to avoid warning of multiple declarations in 1.5 and
+ our 1.4.
Revision 1.2 1997/01/27 14:13:05 jim
Changed the way the C API was exported.
@@ -121,7 +121,26 @@ static struct PycStringIO_CAPI {
#define PycStringIO_OutputCheck(O) \
((O)->ob_type==PycStringIO->OutputType)
+static void *
+xxxPyCObject_Import(char *module_name, char *name)
+{
+ PyObject *m, *c;
+ void *r=NULL;
+
+ if((m=PyImport_ImportModule(module_name)))
+ {
+ if((c=PyObject_GetAttrString(m,name)))
+ {
+ r=PyCObject_AsVoidPtr(c);
+ Py_DECREF(c);
+ }
+ Py_DECREF(m);
+ }
+
+ return r;
+}
+
#define PycString_IMPORT \
- PycStringIO=PyCObject_Import("cStringIO", "cStringIO_CAPI")
+ PycStringIO=xxxPyCObject_Import("cStringIO", "cStringIO_CAPI")
#endif /* CSTRINGIO_INCLUDED */