From e93ad4643202b6227ea9e4ab765cbb272c9d2413 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 6 Feb 2012 14:48:51 +0100 Subject: python/tag.cc: cleanup --- python/tag.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'python') diff --git a/python/tag.cc b/python/tag.cc index b680dc02..88a48df9 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -413,27 +413,23 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) return 0; } + New = (TagFileData*)type->tp_alloc(type, 0); if (fileno > 0) { - New = (TagFileData*)type->tp_alloc(type, 0); #ifdef APT_HAS_GZIP new (&New->Fd) FileFd(); New->Fd.OpenDescriptor(fileno, FileFd::ReadOnlyGzip, false); #else new (&New->Fd) FileFd(fileno,false); #endif - New->Owner = File; - Py_INCREF(New->Owner); - new (&New->Object) pkgTagFile(&New->Fd); } else { - New = (TagFileData*)type->tp_alloc(type, 0); new (&New->Fd) FileFd(filename, FileFd::ReadOnly, FileFd::Extension, false); - New->Owner = File; - Py_INCREF(New->Owner); - new (&New->Object) pkgTagFile(&New->Fd); } + New->Owner = File; + Py_INCREF(New->Owner); + new (&New->Object) pkgTagFile(&New->Fd); // Create the section New->Section = (TagSecData*)(&PyTagSection_Type)->tp_alloc(&PyTagSection_Type, 0); -- cgit v1.2.3