summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-04 19:31:21 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-04 19:31:21 +0000
commitbf529cfd33e76beb9781d4695091d064a6cf40a3 (patch)
tree80f1b47e14e5e084d457e154a64a0f561123ef34 /pym
parentc53137420b0a64da9add50e66a43b7bec21343b9 (diff)
downloadportage-bf529cfd33e76beb9781d4695091d064a6cf40a3.tar.gz
portage-bf529cfd33e76beb9781d4695091d064a6cf40a3.tar.bz2
portage-bf529cfd33e76beb9781d4695091d064a6cf40a3.zip
Make code from previous commit safe for empty files.
svn path=/main/trunk/; revision=13781
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pym/portage/util.py b/pym/portage/util.py
index 1da4b4ba2..8fbf61c12 100644
--- 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: