summaryrefslogtreecommitdiff
path: root/python/tag.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2012-06-17 23:11:16 +0200
committerJulian Andres Klode <jak@debian.org>2012-06-17 23:11:16 +0200
commit4133baa95eaf2a8638c2ad8acea42e061049db02 (patch)
tree8c40ad438c639600248e97c7393a564323d2d280 /python/tag.cc
parent0d6a27849d413e421c3b694a80582080c35d6fd4 (diff)
downloadpython-apt-4133baa95eaf2a8638c2ad8acea42e061049db02.tar.gz
* python/tag.cc:
- Correctly handle file descriptor 0 aka stdin (Closes: #669458)
Diffstat (limited to 'python/tag.cc')
-rw-r--r--python/tag.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/tag.cc b/python/tag.cc
index bf79debf..248d818d 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -461,7 +461,7 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
}
New = (TagFileData*)type->tp_alloc(type, 0);
- if (fileno > 0)
+ if (fileno != -1)
{
#ifdef APT_HAS_GZIP
new (&New->Fd) FileFd();
@@ -483,7 +483,7 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
New->Owner = File;
Py_INCREF(New->Owner);
#if PY_MAJOR_VERSION >= 3
- if (fileno > 0) {
+ if (fileno != -1) {
New->Encoding = PyObject_GetAttr(File, PyUnicode_FromString("encoding"));
if (New->Encoding && !PyUnicode_Check(New->Encoding))
New->Encoding = 0;