summaryrefslogtreecommitdiff
path: root/python/progress.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-21 21:53:36 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-21 21:53:36 +0200
commit1358664af2c27db4d7d62292680013e811f11750 (patch)
treed599ab1e2b82124ee2c9aa05f85cd92babb81c80 /python/progress.h
parent59ca8fafbe93d5aff7ac4baf54877dd1aa5fa036 (diff)
downloadpython-apt-1358664af2c27db4d7d62292680013e811f11750.tar.gz
python/progress.cc: Introduce setattr to reduce code duplication.
This way, we can replace stuff like PyObject *o = PyBuildValue("i", 0); PyObject_SetAttrString(callbackInst, "attribute", o); Py_DECREF(o) with setattr(callbackInst,"attribute","i",0);
Diffstat (limited to 'python/progress.h')
-rw-r--r--python/progress.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/progress.h b/python/progress.h
index 88c0a21b..e92933a7 100644
--- a/python/progress.h
+++ b/python/progress.h
@@ -18,7 +18,7 @@
/* PyCbObj_BEGIN_ALLOW_THREADS and PyCbObj_END_ALLOW_THREADS are sligthly
* modified versions of Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS.
* Instead of storing the thread state in a function-local variable these
- * use a class attribute (with the same) name, allowing blocking and
+ * use a class attribute (with the same) name, allowing blocking and
* unblocking from different class methods.
* Py_BLOCK_THREADS and Py_UNBLOCK_THREADS do not define their own
* local variable but use the one provided by PyCbObj_BEGIN_ALLOW_THREADS
@@ -63,6 +63,7 @@ typedef struct {
} PyAcquireProgressObject;
+
class PyCallbackObj {
protected:
PyObject *callbackInst;