* When available, make getconfig() include an invalid token
in a ParseError message.
(trunk r8883)
svn path=/main/branches/2.1.2/; revision=8885
try:
f=open(mycfg,'r')
except IOError, e:
+ if e.errno == PermissionDenied.errno:
+ raise PermissionDenied(mycfg)
if e.errno != errno.ENOENT:
raise
return None
#invalid token
#lex.error_leader(self.filename,lex.lineno)
if not tolerant:
- writemsg("!!! Invalid token (not \"=\") "+str(equ)+"\n",
- noiselevel=-1)
- raise Exception("ParseError: Invalid token (not '='): "+str(mycfg)+": line "+str(lex.lineno))
+ raise Exception("ParseError: Invalid token " + \
+ "'%s' (not '='): %s: line %s" % \
+ (equ, mycfg, lex.lineno))
else:
return mykeys
val=lex.get_token()