Skip to content
Snippets Groups Projects
Commit 2f85bf66 authored by Wim Lavrijsen's avatar Wim Lavrijsen
Browse files

naming and p2.2 fixups

git-svn-id: http://root.cern.ch/svn/root/trunk@23269 27541ba8-7e3a-0410-8455-c3a389f83636
parent 7377e054
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ from __future__ import generators
# @(#)root/pyroot:$Id$
# Author: Wim Lavrijsen (WLavrijsen@lbl.gov)
# Created: 02/20/03
# Last: 07/02/07
# Last: 04/16/08
"""PyROOT user module.
......@@ -14,7 +14,7 @@ from __future__ import generators
"""
__version__ = '5.0.2'
__version__ = '5.0.3'
__author__ = 'Wim Lavrijsen (WLavrijsen@lbl.gov)'
......@@ -27,7 +27,8 @@ if sys.version[0:3] < '2.2':
raise ImportError, 'Python Version 2.2 or above is required.'
## 2.2 has 10 instructions as default, > 2.3 has 100 ... make same
sys.setcheckinterval( 100 )
if sys.version[0:3] == '2.2':
sys.setcheckinterval( 100 )
## readline support, if available
try:
......@@ -92,6 +93,11 @@ if needsGlobal:
sys.setdlopenflags( dlflags )
del needsGlobal
## convince 2.2 it's ok to use the expand function
if sys.version[0:3] == '2.2':
import copy_reg
copy_reg.constructor( _root._ObjectProxy__expand__ )
### configuration ---------------------------------------------------------------
class _Configuration( object ):
......
......@@ -43,7 +43,7 @@ namespace {
// because it is borrowed, it means that there can be no pickling during the
// shutdown of the libPyROOT module
static PyObject* s_expand = PyDict_GetItemString(
PyModule_GetDict( gRootModule ), const_cast< char* >( "_TObject__expand__" ) );
PyModule_GetDict( gRootModule ), const_cast< char* >( "_ObjectProxy__expand__" ) );
// no cast is needed, but WriteObject taking a TClass argument is protected,
// so use WriteObjectAny()
......
......@@ -312,7 +312,7 @@ namespace {
}
//____________________________________________________________________________
PyObject* TObjectExpand( PyObject*, PyObject* args )
PyObject* ObjectProxyExpand( PyObject*, PyObject* args )
{
// This method and is a helper for pickling for TObject derived classes.
PyObject* pybuf = 0;
......@@ -401,7 +401,7 @@ static PyMethodDef gPyROOTMethods[] = {
METH_VARARGS, (char*) "Create an object of given type, from given address" },
{ (char*) "MakeNullPointer", (PyCFunction)MakeNullPointer,
METH_VARARGS, (char*) "Create a NULL pointer of the given type" },
{ (char*) "_TObject__expand__", (PyCFunction)TObjectExpand,
{ (char*) "_ObjectProxy__expand__", (PyCFunction)ObjectProxyExpand,
METH_VARARGS, (char*) "Helper method for pickling" },
{ (char*) "SetMemoryPolicy", (PyCFunction)SetMemoryPolicy,
METH_VARARGS, (char*) "Determines object ownership model" },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment