diff options
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/util/__init__.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index f31f33d49..8b27be5a3 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -125,8 +125,18 @@ def grabfile(myfilename, compat_level=0, recursive=0, remember_source_file=False for x, source_file in mylines: #the split/join thing removes leading and trailing whitespace, and converts any whitespace in the line #into single spaces. - myline = _unicode_decode(' ').join(x.split()) - if not len(myline): + myline = x.split() + if x and x[0] != "#": + mylinetemp = [] + for item in myline: + if item[:1] != "#": + mylinetemp.append(item) + else: + break + myline = mylinetemp + + myline = " ".join(myline) + if not myline: continue if myline[0]=="#": # Check if we have a compat-level string. BC-integration data. @@ -316,7 +326,7 @@ def grabdict(myfilename, juststrings=0, empty=0, recursive=0, incremental=1): myline=x.split() mylinetemp = [] for item in myline: - if not item.startswith('#'): + if item[:1] != "#": mylinetemp.append(item) else: break |