diff options
-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 0eaaeb209..0e05a4147 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. @@ -351,7 +361,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 |