summaryrefslogtreecommitdiff
path: root/sphinx/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/config.py')
-rw-r--r--sphinx/config.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/sphinx/config.py b/sphinx/config.py
index bbc3297a..4c1e92e1 100644
--- a/sphinx/config.py
+++ b/sphinx/config.py
@@ -144,11 +144,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)