For bug #14215, put the shlex parser in posix mode so that it properly recognizes...
authorZac Medico <zmedico@gentoo.org>
Fri, 6 Oct 2006 02:48:31 +0000 (02:48 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 6 Oct 2006 02:48:31 +0000 (02:48 -0000)
svn path=/main/trunk/; revision=4602

pym/portage_util.py

index c329bc225f01fb6e8edbbae382e7c3e746de1b6b..52cbaa34c41b7637ec60b3e03857123a305467a2 100644 (file)
@@ -235,7 +235,7 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False):
                        raise
                return None
        try:
-               lex=shlex.shlex(f)
+               lex = shlex.shlex(f, posix=True)
                lex.wordchars=string.digits+string.letters+"~!@#$%*_\:;?,./-+{}"     
                lex.quotes="\"'"
                if allow_sourcing:
@@ -244,7 +244,7 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False):
                        key=lex.get_token()
                        if key == "export":
                                key = lex.get_token()
-                       if (key==''):
+                       if key is None:
                                #normal end of file
                                break;
                        equ=lex.get_token()
@@ -267,7 +267,7 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False):
                                else:
                                        return mykeys
                        val=lex.get_token()
-                       if (val==''):
+                       if val is None:
                                #unexpected end of file
                                #lex.error_leader(self.filename,lex.lineno)
                                if not tolerant: