summaryrefslogtreecommitdiff
path: root/python/rpm/__init__.py
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-10-15 11:36:46 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-10-15 11:36:46 +0300
commit7324a69d62f56faa9a621b0554723be85b6cac13 (patch)
tree81984bac77a5db84fb79982f4bfa749d7521bb5d /python/rpm/__init__.py
parented40ff253a88ab399c28cf22005193e7389d5e23 (diff)
downloadlibrpm-tizen-7324a69d62f56faa9a621b0554723be85b6cac13.tar.gz
librpm-tizen-7324a69d62f56faa9a621b0554723be85b6cac13.tar.bz2
librpm-tizen-7324a69d62f56faa9a621b0554723be85b6cac13.zip
Use fd.tell() instead of going around through os.lseek() with fdno
Diffstat (limited to 'python/rpm/__init__.py')
-rw-r--r--python/rpm/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/rpm/__init__.py b/python/rpm/__init__.py
index 82e5f4667..56a72950f 100644
--- a/python/rpm/__init__.py
+++ b/python/rpm/__init__.py
@@ -55,12 +55,12 @@ def readHeaderListFromFile(path, retrofit = True):
def readHeaderFromFD(file_desc):
if not isinstance(file_desc, fd):
file_desc = fd(file_desc)
- offset = os.lseek(file_desc.fileno(), 0, os.SEEK_CUR)
try:
+ offset = file_desc.tell()
h = hdr(file_desc)
- except _rpm.error:
- h = None
+ except (_rpm.error, IOError):
offset = None
+ h = None
return (h, offset)