File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -655,9 +655,11 @@ def parse_pseudo_class(
655
655
m .start (0 )
656
656
)
657
657
else :
658
- raise ValueError (
658
+ raise SelectorSyntaxError (
659
659
f"'{ pseudo } ' was detected as a pseudo-class and is either unsupported or invalid. "
660
- "If the syntax was not intended to be recognized as a pseudo-class, please escape the colon."
660
+ "If the syntax was not intended to be recognized as a pseudo-class, please escape the colon." ,
661
+ self .pattern ,
662
+ m .start (0 )
661
663
)
662
664
663
665
return has_selector , is_html
Original file line number Diff line number Diff line change 1
1
"""Test general pseudo-class cases."""
2
2
from .. import util
3
+ from soupsieve import SelectorSyntaxError
3
4
4
5
5
6
class TestPseudoClass (util .TestCase ):
@@ -8,9 +9,9 @@ class TestPseudoClass(util.TestCase):
8
9
def test_pseudo_class_not_implemented (self ):
9
10
"""Test pseudo-class that is not implemented."""
10
11
11
- self .assert_raises (':not-implemented' , NotImplementedError )
12
+ self .assert_raises (':not-implemented' , SelectorSyntaxError )
12
13
13
14
def test_unrecognized_pseudo (self ):
14
15
"""Test unrecognized pseudo class."""
15
16
16
- self .assert_raises (':before' , NotImplementedError )
17
+ self .assert_raises (':before' , SelectorSyntaxError )
You can’t perform that action at this time.
0 commit comments