-# HG changeset patch
-# User Georg Brandl <georg@python.org>
-# Date 1413746745 -7200
-# Node ID 2d66ade078e490968b21022918b2074389b77dd0
-# Parent 1e2406af4606eb1f03fd48262114938922e949b8
-Guard against sys.exit() called while exec()ing the conf.py file.
-
-diff --git a/sphinx/config.py b/sphinx/config.py
---- a/sphinx/config.py
-+++ b/sphinx/config.py
-@@ -24,6 +24,9 @@
- CONFIG_SYNTAX_ERROR = "There is a syntax error in your configuration file: %s"
- if PY3:
- CONFIG_SYNTAX_ERROR += "\nDid you change the syntax from 2.x to 3.x?"
-+CONFIG_EXIT_ERROR = "The configuration file (or one of the modules it imports) " \
-+ "called sys.exit()"
-+
-
- class Config(object):
- """
-@@ -232,6 +232,8 @@ class Config(object):
- execfile_(filename, config)
- except SyntaxError, err:
- raise ConfigError(CONFIG_SYNTAX_ERROR % err)
-+ except SystemExit:
-+ raise ConfigError(CONFIG_EXIT_ERROR)
- finally:
- os.chdir(olddir)
-
-