summaryrefslogtreecommitdiff
path: root/python/tag.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2013-10-08 17:59:31 +0200
committerJulian Andres Klode <jak@debian.org>2013-10-08 17:59:31 +0200
commit222a1e27d5a50e255dfacf5378225b9ec78dd124 (patch)
tree319f45df456d6a279763cbfdded8effa5bfd791e /python/tag.cc
parent7aedf6d986f15d31d9597c139d91c761baf98f73 (diff)
downloadpython-apt-222a1e27d5a50e255dfacf5378225b9ec78dd124.tar.gz
apt_pkg: Support paths supplied as bytes objects (See: #680971)
We should be done now. DO NOT MERGE
Diffstat (limited to 'python/tag.cc')
-rw-r--r--python/tag.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/python/tag.cc b/python/tag.cc
index a0f526ad..9f175cc4 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -435,9 +435,8 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
// check if we got a filename or a file object
int fileno = -1;
- const char *filename = NULL;
- filename = PyObject_AsString(File);
- if (filename == NULL) {
+ PyApt_Filename filename;
+ if (!filename.init(File)) {
PyErr_Clear();
fileno = PyObject_AsFileDescriptor(File);
}