Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
2ff137b9
Commit
2ff137b9
authored
May 17, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I didn't realize PyRunString returned objects. Ugh. What does
it return?
parent
750f6a20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
lib/Components/cPickle/cPickle.c
lib/Components/cPickle/cPickle.c
+20
-18
No files found.
lib/Components/cPickle/cPickle.c
View file @
2ff137b9
/*
* $Id: cPickle.c,v 1.6
7 1999/05/12 16:09:45
jim Exp $
* $Id: cPickle.c,v 1.6
8 1999/05/17 16:15:39
jim Exp $
*
* Copyright (c) 1996-1998, Digital Creations, Fredericksburg, VA, USA.
* All rights reserved.
...
...
@@ -49,7 +49,7 @@
static
char
cPickle_module_documentation
[]
=
"C implementation and optimization of the Python pickle module
\n
"
"
\n
"
"$Id: cPickle.c,v 1.6
7 1999/05/12 16:09:45
jim Exp $
\n
"
"$Id: cPickle.c,v 1.6
8 1999/05/17 16:15:39
jim Exp $
\n
"
;
#include "Python.h"
...
...
@@ -4251,7 +4251,7 @@ if (PyErr_Occurred()) { \
static
int
init_stuff
(
PyObject
*
module
,
PyObject
*
module_dict
)
{
PyObject
*
string
,
*
copy_reg
,
*
t
;
PyObject
*
string
,
*
copy_reg
,
*
t
,
*
r
;
#define INIT_STR(S) UNLESS(S ## _str=PyString_FromString(#S)) return -1;
...
...
@@ -4308,12 +4308,13 @@ init_stuff(PyObject *module, PyObject *module_dict) {
return
-
1
;
UNLESS
(
t
=
PyDict_New
())
return
-
1
;
if
(
PyRun_String
(
"def __init__(self, *args): self.args=args
\n\n
"
"def __str__(self):
\n
"
" return self.args and ('%s' % self.args[0]) or '???'
\n
"
,
Py_file_input
,
module_dict
,
t
)
<
0
)
return
-
1
;
UNLESS
(
r
=
PyRun_String
(
"def __init__(self, *args): self.args=args
\n\n
"
"def __str__(self):
\n
"
" return self.args and ('%s' % self.args[0]) or '???'
\n
"
,
Py_file_input
,
module_dict
,
t
)
)
return
-
1
;
Py_DECREF
(
r
);
UNLESS
(
PickleError
=
PyErr_NewException
(
"cPickle.PickleError"
,
NULL
,
t
))
return
-
1
;
...
...
@@ -4326,14 +4327,15 @@ init_stuff(PyObject *module, PyObject *module_dict) {
return
-
1
;
UNLESS
(
t
=
PyDict_New
())
return
-
1
;
if
(
PyRun_String
(
"def __init__(self, *args): self.args=args
\n\n
"
"def __str__(self):
\n
"
" a=self.args
\n
"
" a=a and type(a[0]) or '(what)'
\n
"
" return 'Cannot pickle %s objects' % a
\n
"
,
Py_file_input
,
module_dict
,
t
)
<
0
)
return
-
1
;
UNLESS
(
r
=
PyRun_String
(
"def __init__(self, *args): self.args=args
\n\n
"
"def __str__(self):
\n
"
" a=self.args
\n
"
" a=a and type(a[0]) or '(what)'
\n
"
" return 'Cannot pickle %s objects' % a
\n
"
,
Py_file_input
,
module_dict
,
t
)
)
return
-
1
;
Py_DECREF
(
r
);
UNLESS
(
UnpickleableError
=
PyErr_NewException
(
"cPickle.UnpickleableError"
,
PicklingError
,
t
))
...
...
@@ -4379,7 +4381,7 @@ init_stuff(PyObject *module, PyObject *module_dict) {
DL_EXPORT
(
void
)
initcPickle
()
{
PyObject
*
m
,
*
d
,
*
v
;
char
*
rev
=
"$Revision: 1.6
7
$"
;
char
*
rev
=
"$Revision: 1.6
8
$"
;
PyObject
*
format_version
;
PyObject
*
compatible_formats
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment