From: Liang Sun Date: Mon, 4 Nov 2013 10:03:33 +0000 (+0800) Subject: Add name parameter for URLSpec in tuple/list format. X-Git-Tag: v3.2.0b1~48^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F926%2Fhead;p=thirdparty%2Ftornado.git Add name parameter for URLSpec in tuple/list format. --- diff --git a/tornado/web.py b/tornado/web.py index a19e75f03..e6598bb04 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -1564,15 +1564,8 @@ class Application(object): for spec in host_handlers: if isinstance(spec, (tuple, list)): - assert len(spec) in (2, 3) - pattern = spec[0] - handler = spec[1] - - if len(spec) == 3: - kwargs = spec[2] - else: - kwargs = {} - spec = URLSpec(pattern, handler, kwargs) + assert len(spec) in (2, 3, 4) + spec = URLSpec(*spec) handlers.append(spec) if spec.name: if spec.name in self.named_handlers: