From c2379f7c2105d3ea1460e1c5214ae8b426bd83d9 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 12 Jan 2010 20:53:43 +0000 Subject: [PATCH] Remove Python 2.5ism and undefined local access. --- sphinx/builders/latex.py | 2 +- sphinx/config.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py index eed4787d5..751bf28cd 100644 --- a/sphinx/builders/latex.py +++ b/sphinx/builders/latex.py @@ -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") diff --git a/sphinx/config.py b/sphinx/config.py index 990849c93..4cd514921 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -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)