projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ed40ff2
)
Use fd.tell() instead of going around through os.lseek() with fdno
author
Panu Matilainen
<pmatilai@redhat.com>
Thu, 15 Oct 2009 08:36:46 +0000
(11:36 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Thu, 15 Oct 2009 08:36:46 +0000
(11:36 +0300)
python/rpm/__init__.py
patch
|
blob
|
history
diff --git
a/python/rpm/__init__.py
b/python/rpm/__init__.py
index
82e5f46
..
56a7295
100644
(file)
--- 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)