From ee214d6df5265ef0b0d55ce4aeb54aca305fcb5e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Feb 2015 17:38:59 +0530 Subject: [PATCH] Micro optimization --- src/css_selectors/select.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/css_selectors/select.py b/src/css_selectors/select.py index 71fbf4bd0e..0d29d4f906 100644 --- a/src/css_selectors/select.py +++ b/src/css_selectors/select.py @@ -507,13 +507,13 @@ def select_nth_last_of_type(cache, function, elem): # Pseudo elements {{{ def select_pseudo(cache, pseudo): - if pseudo.ident == 'root': - yield cache.root - return - try: func = cache.dispatch_map[pseudo.ident.replace('-', '_')] except KeyError: + if pseudo.ident == 'root': + yield cache.root + return + raise ExpressionError( "The pseudo-class :%s is not supported" % pseudo.ident)