~pythonregexp2.7/python/issue2636

« back to all changes in this revision

Viewing changes to Modules/cPickle.c

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-05-24 16:05:21 UTC
  • mfrom: (39021.1.401 Regexp-2.6)
  • Revision ID: darklord@timehorse.com-20080524160521-1xenj7p6u3wb89et
Merged in changes from the latest python source snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
  *__reduce_ex___str,
125
125
  *write_str, *append_str,
126
126
  *read_str, *readline_str, *__main___str, 
127
 
  *copy_reg_str, *dispatch_table_str;
 
127
  *copyreg_str, *dispatch_table_str;
128
128
 
129
129
/*************************************************************************
130
130
 Internal Data type for pickle data.                                     */
2856
2856
 
2857
2857
        if (PyEval_GetRestricted()) {
2858
2858
                /* Restricted execution, get private tables */
2859
 
                PyObject *m = PyImport_Import(copy_reg_str);
 
2859
                PyObject *m = PyImport_Import(copyreg_str);
2860
2860
 
2861
2861
                if (m == NULL)
2862
2862
                        goto err;
5566
5566
static int
5567
5567
init_stuff(PyObject *module_dict)
5568
5568
{
5569
 
        PyObject *copy_reg, *t, *r;
 
5569
        PyObject *copyreg, *t, *r;
5570
5570
 
5571
5571
#define INIT_STR(S) if (!( S ## _str=PyString_InternFromString(#S)))  return -1;
5572
5572
 
5588
5588
        INIT_STR(append);
5589
5589
        INIT_STR(read);
5590
5590
        INIT_STR(readline);
5591
 
        INIT_STR(copy_reg);
 
5591
        INIT_STR(copyreg);
5592
5592
        INIT_STR(dispatch_table);
5593
5593
 
5594
 
        if (!( copy_reg = PyImport_ImportModule("copy_reg")))
 
5594
        if (!( copyreg = PyImport_ImportModule("copy_reg")))
5595
5595
                return -1;
5596
5596
 
5597
5597
        /* This is special because we want to use a different
5598
5598
           one in restricted mode. */
5599
 
        dispatch_table = PyObject_GetAttr(copy_reg, dispatch_table_str);
 
5599
        dispatch_table = PyObject_GetAttr(copyreg, dispatch_table_str);
5600
5600
        if (!dispatch_table) return -1;
5601
5601
 
5602
 
        extension_registry = PyObject_GetAttrString(copy_reg,
 
5602
        extension_registry = PyObject_GetAttrString(copyreg,
5603
5603
                                "_extension_registry");
5604
5604
        if (!extension_registry) return -1;
5605
5605
 
5606
 
        inverted_registry = PyObject_GetAttrString(copy_reg,
 
5606
        inverted_registry = PyObject_GetAttrString(copyreg,
5607
5607
                                "_inverted_registry");
5608
5608
        if (!inverted_registry) return -1;
5609
5609
 
5610
 
        extension_cache = PyObject_GetAttrString(copy_reg,
 
5610
        extension_cache = PyObject_GetAttrString(copyreg,
5611
5611
                                "_extension_cache");
5612
5612
        if (!extension_cache) return -1;
5613
5613
 
5614
 
        Py_DECREF(copy_reg);
 
5614
        Py_DECREF(copyreg);
5615
5615
 
5616
5616
        if (!(empty_tuple = PyTuple_New(0)))
5617
5617
                return -1;
5710
5710
        PyObject *format_version;
5711
5711
        PyObject *compatible_formats;
5712
5712
 
 
5713
        /* XXX: Should mention that the pickle module will include the C
 
5714
           XXX: optimized implementation automatically. */
 
5715
        if (PyErr_WarnPy3k("the cPickle module has been removed in "
 
5716
                           "Python 3.0", 2) < 0)
 
5717
                return;
 
5718
 
5713
5719
        Py_TYPE(&Picklertype) = &PyType_Type;
5714
5720
        Py_TYPE(&Unpicklertype) = &PyType_Type;
5715
5721
        Py_TYPE(&PdataType) = &PyType_Type;