Remove Python 2.5ism and undefined local access.

This commit is contained in:
Georg Brandl 2010-01-12 20:53:43 +00:00
parent 1b725c3acf
commit c2379f7c21
2 changed files with 7 additions and 6 deletions

View File

@ -107,7 +107,7 @@ class LaTeXBuilder(Builder):
except UnicodeError:
self.warn("a Unicode error occurred when writing the output. "
"Please make sure all config values that contain "
"non-ASCII content are Unicode strings." % pagename)
"non-ASCII content are Unicode strings.")
return
self.info("done")

View File

@ -121,11 +121,12 @@ class Config(object):
config['tags'] = tags
olddir = os.getcwd()
try:
os.chdir(dirname)
execfile(config['__file__'], config)
except SyntaxError, err:
raise ConfigError('There is a syntax error in your '
'configuration file: ' + str(err))
try:
os.chdir(dirname)
execfile(config['__file__'], config)
except SyntaxError, err:
raise ConfigError('There is a syntax error in your '
'configuration file: ' + str(err))
finally:
os.chdir(olddir)