diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-06-29 16:10:40 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-06-29 16:10:40 +0200 |
| commit | 794e9321c92aab78c3b7123d765967ba67b79851 (patch) | |
| tree | 9886905374b0ae9bc0043f12be0797c6f8f0af35 /python/configuration.cc | |
| parent | 43aee9eda68e374067d6d6a9c4dd3c3e9b986041 (diff) | |
| parent | 6ec2e17ae6712655c1bacffa8c6ecde5f8810960 (diff) | |
| download | python-apt-794e9321c92aab78c3b7123d765967ba67b79851.tar.gz | |
merged from debian-sid
Diffstat (limited to 'python/configuration.cc')
| -rw-r--r-- | python/configuration.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/python/configuration.cc b/python/configuration.cc index 3e634901..37374625 100644 --- a/python/configuration.cc +++ b/python/configuration.cc @@ -331,13 +331,16 @@ static PyObject *CnfMap(PyObject *Self,PyObject *Arg) // Assignment with operator [] static int CnfMapSet(PyObject *Self,PyObject *Arg,PyObject *Val) { - if (PyString_Check(Arg) == 0 || PyString_Check(Val) == 0) + if (PyString_Check(Arg) == 0 || (Val != NULL && PyString_Check(Val) == 0)) { PyErr_SetNone(PyExc_TypeError); return -1; } - GetSelf(Self).Set(PyString_AsString(Arg),PyString_AsString(Val)); + if (Val == NULL) + GetSelf(Self).Clear(PyString_AsString(Arg)); + else + GetSelf(Self).Set(PyString_AsString(Arg),PyString_AsString(Val)); return 0; } /*}}}*/ |
