[Pkg-python-debian-commits] r77 trunk: return None as the content of files with ... well, no content (e.g. directories)
zack at bononia.it
zack at bononia.it
Sat Jul 14 18:56:00 UTC 2007
------------------------------------------------------------
revno: 77
committer: zack at bononia.it
branch nick: pkg-python-debian.debfile
timestamp: Sat 2007-07-14 20:56:00 +0200
message:
return None as the content of files with ... well, no content (e.g. directories)
modified:
debian_bundle/debfile.py
-------------- next part --------------
=== modified file 'debian_bundle/debfile.py'
--- a/debian_bundle/debfile.py 2007-07-14 17:02:28 +0000
+++ b/debian_bundle/debfile.py 2007-07-14 18:56:00 +0000
@@ -53,11 +53,14 @@
return (self.tgz().extractfile(fname))
def get_content(self, fname):
- """Return the string content of a given file."""
+ """Return the string content of a given file, or None (e.g. for
+ directories)."""
f = self.tgz().extractfile(fname)
- content = f.read()
- f.close()
+ content = None
+ if f: # can be None for non regular or link files
+ content = f.read()
+ f.close()
return content
# container emulation
More information about the pkg-python-debian-commits
mailing list