git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use functions for sequence instead of tuple or list.. so both types are
[enigma2.git]
/
lib
/
base
/
console.cpp
diff --git
a/lib/base/console.cpp
b/lib/base/console.cpp
index c266de3ede7a9390153dabc189e22e899fcac386..db501945b132d3162943c9ca851c3c410271284f 100644
(file)
--- a/
lib/base/console.cpp
+++ b/
lib/base/console.cpp
@@
-362,10
+362,8
@@
eListCompatibilityWrapper_clear(eListCompatibilityWrapper *self)
static void
eListCompatibilityWrapper_dealloc(eListCompatibilityWrapper* self)
{
static void
eListCompatibilityWrapper_dealloc(eListCompatibilityWrapper* self)
{
- eDebug("eListCompatibilityWrapper_dealloc(eListCompatibilityWrapper* self) %p", self);
if (self->in_weakreflist != NULL)
PyObject_ClearWeakRefs((PyObject *) self);
if (self->in_weakreflist != NULL)
PyObject_ClearWeakRefs((PyObject *) self);
- eDebug("wrapper->list is %p",self->list);
eListCompatibilityWrapper_clear(self);
Org_Py_DECREF(self->list);
self->ob_type->tp_free((PyObject*)self);
eListCompatibilityWrapper_clear(self);
Org_Py_DECREF(self->list);
self->ob_type->tp_free((PyObject*)self);
@@
-374,7
+372,6
@@
eListCompatibilityWrapper_dealloc(eListCompatibilityWrapper* self)
static PyObject *
eListCompatibilityWrapper_get(eListCompatibilityWrapper *self, void *closure)
{
static PyObject *
eListCompatibilityWrapper_get(eListCompatibilityWrapper *self, void *closure)
{
- eDebug("eListCompatibilityWrapper_get(eListCompatibilityWrapper *self, void *closure)");
Org_Py_INCREF(self->list);
return self->list;
}
Org_Py_INCREF(self->list);
return self->list;
}
@@
-623,16
+620,18
@@
eConsolePy_execute(eConsolePy* self, PyObject *argt)
if (PyTuple_Size(argt) > 1)
{
PyObject *cmdline, *args;
if (PyTuple_Size(argt) > 1)
{
PyObject *cmdline, *args;
- PyArg_ParseTuple(arg
s
, "OO", &cmdline, &args);
- if (!PyString_Check(cmdline) || !Py
List
_Check(args))
+ PyArg_ParseTuple(arg
t
, "OO", &cmdline, &args);
+ if (!PyString_Check(cmdline) || !Py
Sequence
_Check(args))
return PyInt_FromLong(-2);
else
{
return PyInt_FromLong(-2);
else
{
- const char *argv[PyList_Size(args) + 1];
+ PyObject *fast = PySequence_Fast(args, "2nd arg is not a sequence");
+ Py_ssize_t size = PySequence_Fast_GET_SIZE(fast);
+ const char *argv[size + 1];
int i=0;
int i=0;
- for (; i <
PyList_Size(args)
; ++i)
+ for (; i <
size
; ++i)
{
{
- PyObject *arg = Py
List_GetItem(args
, i); /* borrowed ref */
+ PyObject *arg = Py
Sequence_Fast_GET_ITEM(fast
, i); /* borrowed ref */
if (!PyString_Check(arg))
return PyInt_FromLong(-3);
argv[i] = PyString_AsString(arg); /* borrowed pointer */
if (!PyString_Check(arg))
return PyInt_FromLong(-3);
argv[i] = PyString_AsString(arg); /* borrowed pointer */