From e7c30c40488ed373109dfdabd316d87d92b33655 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 6 Oct 2006 02:48:31 +0000 Subject: For bug #14215, put the shlex parser in posix mode so that it properly recognizes escaped quotes. svn path=/main/trunk/; revision=4602 --- pym/portage_util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pym') diff --git a/pym/portage_util.py b/pym/portage_util.py index c329bc225..52cbaa34c 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -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: -- cgit v1.2.3-1-g7c22