summaryrefslogtreecommitdiffstats
path: root/RISCOS
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 (GMT)
commitdd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch)
treeb2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /RISCOS
parente98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff)
downloadcpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.zip
cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.gz
cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.bz2
This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
Diffstat (limited to 'RISCOS')
-rw-r--r--RISCOS/Modules/drawfmodule.c12
-rw-r--r--RISCOS/Modules/riscosmodule.c10
-rw-r--r--RISCOS/Modules/swimodule.c22
3 files changed, 22 insertions, 22 deletions
diff --git a/RISCOS/Modules/drawfmodule.c b/RISCOS/Modules/drawfmodule.c
index 61aadd3..5f8dc3e 100644
--- a/RISCOS/Modules/drawfmodule.c
+++ b/RISCOS/Modules/drawfmodule.c
@@ -333,7 +333,7 @@ static PyObject *DrawF_FontTable(PyDrawFObject *self,PyObject *arg)
char *dtable;
if(!PyArg_ParseTuple(arg,"O!",&PyDict_Type,&d)) return NULL;
while(PyDict_Next(d,&n,&key,&value))
- { int m=PyBytes_Size(value);
+ { int m=PyString_Size(value);
if(m<0||!PyInt_Check(key)) return NULL;
size+=m+2;
}
@@ -350,9 +350,9 @@ static PyObject *DrawF_FontTable(PyDrawFObject *self,PyObject *arg)
memset(dtable,0,size-8);
n=0;
while(PyDict_Next(d,&n,&key,&value))
- { int m=PyBytes_Size(value);
+ { int m=PyString_Size(value);
*dtable=(char)PyInt_AsLong(key);
- strcpy(dtable+1,PyBytes_AsString(value));
+ strcpy(dtable+1,PyString_AsString(value));
dtable+=m+2;
}
Py_INCREF(Py_None);return Py_None;
@@ -609,8 +609,8 @@ static PyObject *PyDrawF_GetAttr(PyDrawFObject *s,char *name)
if (!strcmp(name, "__members__"))
{ PyObject *list = PyList_New(2);
if (list)
- { PyList_SetItem(list, 0, PyBytes_FromString("size"));
- PyList_SetItem(list, 1, PyBytes_FromString("start"));
+ { PyList_SetItem(list, 0, PyString_FromString("size"));
+ PyList_SetItem(list, 1, PyString_FromString("start"));
if (PyErr_Occurred()) { Py_DECREF(list);list = NULL;}
}
return list;
@@ -659,6 +659,6 @@ void initdrawf()
{ PyObject *m, *d;
m = Py_InitModule("drawf", DrawFMethods);
d = PyModule_GetDict(m);
- DrawFError=PyBytes_FromString("drawf.error");
+ DrawFError=PyString_FromString("drawf.error");
PyDict_SetItemString(d,"error",DrawFError);
}
diff --git a/RISCOS/Modules/riscosmodule.c b/RISCOS/Modules/riscosmodule.c
index cf37e18..3dabb4d 100644
--- a/RISCOS/Modules/riscosmodule.c
+++ b/RISCOS/Modules/riscosmodule.c
@@ -79,9 +79,9 @@ canon(char *path)
char *buf;
e=xosfscontrol_canonicalise_path(path,0,0,0,0,&len);
if(e) return riscos_oserror();
- obj=PyBytes_FromStringAndSize(NULL,-len);
+ obj=PyString_FromStringAndSize(NULL,-len);
if(obj==NULL) return NULL;
- buf=PyBytes_AsString(obj);
+ buf=PyString_AsString(obj);
e=xosfscontrol_canonicalise_path(path,buf,0,0,1-len,&len);
if(len!=1) return riscos_error("Error expanding path");
if(!e) return obj;
@@ -131,7 +131,7 @@ riscos_listdir(PyObject *self, PyObject *args)
{ Py_DECREF(d);return riscos_oserror();
}
if(count)
- { v=PyBytes_FromString(buf);
+ { v=PyString_FromString(buf);
if(!v) { Py_DECREF(d);return 0;}
if(PyList_Append(d,v)) {Py_DECREF(d);Py_DECREF(v);return 0;}
}
@@ -320,7 +320,7 @@ riscos_getenv(PyObject *self, PyObject *args)
char *name,*value;
if(!PyArg_ParseTuple(args,"s:getenv",&name)) return NULL;
value=getenv(name);
- if(value) return PyBytes_FromString(value);
+ if(value) return PyString_FromString(value);
Py_INCREF(Py_None);
return Py_None;
}
@@ -371,7 +371,7 @@ riscos_getenvdict(PyObject *self, PyObject *args)
os_VARTYPE_EXPANDED,&size,(int *)&context,0))
{ PyObject *v;
value[size]='\0';
- v = PyBytes_FromString(value);
+ v = PyString_FromString(value);
if (v == NULL) continue;
PyDict_SetItemString(dict, context, v);
Py_DECREF(v);
diff --git a/RISCOS/Modules/swimodule.c b/RISCOS/Modules/swimodule.c
index 18be42e..b241276 100644
--- a/RISCOS/Modules/swimodule.c
+++ b/RISCOS/Modules/swimodule.c
@@ -66,10 +66,10 @@ static PyObject *PyBlock_New(PyObject *self,PyObject *args)
b->length=4*size;
b->heap=1;
if(init)
- { if(PyBytes_Check(init))
- { int n=PyBytes_Size(init);
+ { if(PyString_Check(init))
+ { int n=PyString_Size(init);
if (n>4*size) n=4*size;
- memcpy(b->block,PyBytes_AsString(init),n);
+ memcpy(b->block,PyString_AsString(init),n);
memset((char*)b->block+n,0,4*size-n);
}
else
@@ -113,7 +113,7 @@ static PyObject *PyBlock_ToString(PyBlockObject *self,PyObject *arg)
{ PyErr_SetString(PyExc_IndexError,"block index out of range");
return NULL;
}
- return PyBytes_FromStringAndSize((char*)self->block+s,e-s);
+ return PyString_FromStringAndSize((char*)self->block+s,e-s);
}
static PyObject *PyBlock_NullString(PyBlockObject *self,PyObject *arg)
@@ -125,7 +125,7 @@ static PyObject *PyBlock_NullString(PyBlockObject *self,PyObject *arg)
return NULL;
}
for(i=s;i<e;i++) if(p[i]==0) break;
- return PyBytes_FromStringAndSize((char*)self->block+s,i-s);
+ return PyString_FromStringAndSize((char*)self->block+s,i-s);
}
static PyObject *PyBlock_CtrlString(PyBlockObject *self,PyObject *arg)
@@ -137,7 +137,7 @@ static PyObject *PyBlock_CtrlString(PyBlockObject *self,PyObject *arg)
return NULL;
}
for(i=s;i<e;i++) if(p[i]<32) break;
- return PyBytes_FromStringAndSize((char*)self->block+s,i-s);
+ return PyString_FromStringAndSize((char*)self->block+s,i-s);
}
static PyObject *PyBlock_PadString(PyBlockObject *self,PyObject *arg)
@@ -296,9 +296,9 @@ static PyObject *PyBlock_GetAttr(PyBlockObject *s,char *name)
if (!strcmp(name, "__members__"))
{ PyObject *list = PyList_New(3);
if (list)
- { PyList_SetItem(list, 0, PyBytes_FromString("length"));
- PyList_SetItem(list, 1, PyBytes_FromString("start"));
- PyList_SetItem(list, 2, PyBytes_FromString("end"));
+ { PyList_SetItem(list, 0, PyString_FromString("length"));
+ PyList_SetItem(list, 1, PyString_FromString("start"));
+ PyList_SetItem(list, 2, PyString_FromString("end"));
if (PyErr_Occurred()) { Py_DECREF(list);list = NULL;}
}
return list;
@@ -402,7 +402,7 @@ static PyObject *swi_swi(PyObject *self,PyObject *args)
for(;*fmt;fmt++)
{ switch(*fmt)
{ case 'i':v=PyInt_FromLong((long)r.r[rno++]); break;
- case 's':v=PyBytes_FromString((char*)(r.r[rno++])); break;
+ case 's':v=PyString_FromString((char*)(r.r[rno++])); break;
case '.':rno++; continue;
case '*':v=PyInt_FromLong((long)carry); break;
}
@@ -421,7 +421,7 @@ static PyObject *swi_string(PyObject *self, PyObject *arg)
if(!PyArg_ParseTuple(arg,"i|i",(unsigned int *)&s, &l)) return NULL;
if (l==-1)
l = strlen(s);
- return PyBytes_FromStringAndSize((char*)s, l);
+ return PyString_FromStringAndSize((char*)s, l);
}
static char swi_string__doc__[] =