From 99d06f3646d8f60f8d58aba1b85b1fe1eb0b8f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Raczy=C5=84ski?= Date: Tue, 26 Jan 2016 23:03:34 +0100 Subject: [PATCH] Fixed --browser behaviour when --server-name provided Fixed PR #1533. Calling: pserve --server-name abc --browser app.ini caused error : "LookupError: No section 'main' (prefixed by 'server') found in config app.ini" --- pyramid/scripts/pserve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py index 155b82bdc4..6737966ba3 100644 --- a/pyramid/scripts/pserve.py +++ b/pyramid/scripts/pserve.py @@ -9,7 +9,7 @@ # lib/site.py import atexit -import ctypes +import ctypes. import errno import logging import optparse @@ -391,7 +391,7 @@ def serve(): if self.options.browser: def open_browser(): - context = loadcontext(SERVER, app_spec, name=app_name, relative_to=base, + context = loadcontext(SERVER, app_spec, name=server_name, relative_to=base, global_conf=vars) url = 'http://127.0.0.1:{port}/'.format(**context.config()) time.sleep(1)