projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c531374
)
Make code from previous commit safe for empty files.
author
Zac Medico
<zmedico@gentoo.org>
Sat, 4 Jul 2009 19:31:21 +0000
(19:31 -0000)
committer
Zac Medico
<zmedico@gentoo.org>
Sat, 4 Jul 2009 19:31:21 +0000
(19:31 -0000)
svn path=/main/trunk/; revision=13781
pym/portage/util.py
patch
|
blob
|
history
diff --git
a/pym/portage/util.py
b/pym/portage/util.py
index 1da4b4ba289a69760f5f861b85a7b97b1391b978..8fbf61c12fcf084b69c8ecf718464bdacc2ff658 100644
(file)
--- a/
pym/portage/util.py
+++ b/
pym/portage/util.py
@@
-368,7
+368,7
@@
def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True):
# is triggered by a source statement at the end of the file without a
# trailing newline after the source statement
content = codecs.open(mycfg, mode='r', errors='replace').read()
- if content[-1] != u'\n':
+ if content
and content
[-1] != u'\n':
content += u'\n'
f = StringIO(content)
except IOError, e: