summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Abramowitz <marc@marc-abramowitz.com>2016-04-06 13:48:45 -0700
committerMarc Abramowitz <marc@marc-abramowitz.com>2016-04-06 13:48:45 -0700
commit44809378b8e1d53cc2d5482b08d92a208e9fbfdb (patch)
tree0f6c0d25be331515fdd7f2e17988c7a877e85cae
parent23feec43c9005001ba2ea4cd401d52ff83cf4081 (diff)
downloadpyramid-44809378b8e1d53cc2d5482b08d92a208e9fbfdb.tar.gz
pyramid-44809378b8e1d53cc2d5482b08d92a208e9fbfdb.tar.bz2
pyramid-44809378b8e1d53cc2d5482b08d92a208e9fbfdb.zip
Simplify setup_logging global_conf handling
A somewhat simpler and nicer implementation of handling `global_conf` than what I had in https://github.com/Pylons/pyramid/pull/2399
-rw-r--r--pyramid/paster.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/pyramid/paster.py b/pyramid/paster.py
index b371eea6f..3916be8f0 100644
--- a/pyramid/paster.py
+++ b/pyramid/paster.py
@@ -69,15 +69,12 @@ def setup_logging(config_uri, global_conf=None,
parser.read([path])
if parser.has_section('loggers'):
config_file = os.path.abspath(path)
- if global_conf:
- # Copy to avoid side effects
- global_conf = dict(global_conf)
- else:
- global_conf = {}
- global_conf.update(
+ full_global_conf = dict(
__file__=config_file,
here=os.path.dirname(config_file))
- return fileConfig(config_file, global_conf)
+ if global_conf:
+ full_global_conf.update(global_conf)
+ return fileConfig(config_file, full_global_conf)
def _getpathsec(config_uri, name):
if '#' in config_uri: