~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Modules/cPickle.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
  *__reduce_ex___str,
133
133
  *write_str, *append_str,
134
134
  *read_str, *readline_str, *__main___str, 
135
 
  *copyreg_str, *dispatch_table_str;
 
135
  *dispatch_table_str;
136
136
 
137
137
/*************************************************************************
138
138
 Internal Data type for pickle data.                                     */
2985
2985
 
2986
2986
        if (PyEval_GetRestricted()) {
2987
2987
                /* Restricted execution, get private tables */
2988
 
                PyObject *m = PyImport_Import(copyreg_str);
 
2988
                PyObject *m = PyImport_ImportModule("copy_reg");
2989
2989
 
2990
2990
                if (m == NULL)
2991
2991
                        goto err;
4033
4033
        */
4034
4034
        if (self->num_marks > 0 && self->marks[self->num_marks - 1] == len) {
4035
4035
                self->num_marks--;
4036
 
        } else if (len >= 0) {
 
4036
        } else if (len > 0) {
4037
4037
                len--;
4038
4038
                Py_DECREF(self->stack->data[len]);
4039
4039
                self->stack->length = len;
5733
5733
        INIT_STR(append);
5734
5734
        INIT_STR(read);
5735
5735
        INIT_STR(readline);
5736
 
        INIT_STR(copyreg);
5737
5736
        INIT_STR(dispatch_table);
5738
5737
 
5739
5738
        if (!( copyreg = PyImport_ImportModule("copy_reg")))
5855
5854
        PyObject *format_version;
5856
5855
        PyObject *compatible_formats;
5857
5856
 
5858
 
        /* XXX: Should mention that the pickle module will include the C
5859
 
           XXX: optimized implementation automatically. */
5860
 
        if (PyErr_WarnPy3k("the cPickle module has been removed in "
5861
 
                           "Python 3.0", 2) < 0)
5862
 
                return;
5863
 
 
5864
5857
        Py_TYPE(&Picklertype) = &PyType_Type;
5865
5858
        Py_TYPE(&Unpicklertype) = &PyType_Type;
5866
5859
        Py_TYPE(&PdataType) = &PyType_Type;