summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpjenvey <devnull@localhost>2008-04-22 05:20:46 +0000
committerpjenvey <devnull@localhost>2008-04-22 05:20:46 +0000
commitfb501c884cfb46bbfef412ad309f48a6cc99ebc4 (patch)
treebb137b6d68dbf50610a7ca7235f7fe4e10fe266e
parentfcd318a36871ce91cab9c9ab56731b374b431b2f (diff)
downloadpastedeploy-fb501c884cfb46bbfef412ad309f48a6cc99ebc4.tar.gz
fixed use sections overwriting the config's __file__ value with the use'd
filename
-rw-r--r--docs/news.txt2
-rw-r--r--paste/deploy/loadwsgi.py3
-rw-r--r--tests/test_config.py2
3 files changed, 6 insertions, 1 deletions
diff --git a/docs/news.txt b/docs/news.txt
index e121fbc..ad867fc 100644
--- a/docs/news.txt
+++ b/docs/news.txt
@@ -5,6 +5,8 @@ svn trunk
---------
* Added ``paste.deploy.converters.asint()``.
+* fixed use sections overwriting the config's __file__ value with the
+ use'd filename.
1.3.1
-----
diff --git a/paste/deploy/loadwsgi.py b/paste/deploy/loadwsgi.py
index 29e880d..bd2ff75 100644
--- a/paste/deploy/loadwsgi.py
+++ b/paste/deploy/loadwsgi.py
@@ -420,6 +420,9 @@ class ConfigLoader(_Loader):
object_type, name=use, global_conf=global_conf)
context.global_conf.update(global_additions)
context.local_conf.update(local_conf)
+ if '__file__' in global_conf:
+ # use sections shouldn't overwrite the original __file__
+ context.global_conf['__file__'] = global_conf['__file__']
# @@: Should loader be overwritten?
context.loader = self
return context
diff --git a/tests/test_config.py b/tests/test_config.py
index 6fffe82..26ba482 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -63,7 +63,7 @@ def test_foreign_config():
'def3': 'c',
'glob': 'override',
'here': config_path,
- '__file__': os.path.join(config_path, 'test_config_included.ini')}
+ '__file__': os.path.join(config_path, 'test_config.ini')}
def test_config_get():
app = loadapp(ini_file, relative_to=here, name='test_get')