From 44809378b8e1d53cc2d5482b08d92a208e9fbfdb Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Wed, 6 Apr 2016 13:48:45 -0700 Subject: 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 --- pyramid/paster.py | 11 ++++------- 1 file 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: -- cgit v1.2.3