Skip to content

Commit d595d0a

Browse files
authored
Merge pull request #373 from willkg/371-reparse-private
Make ReparseException private
2 parents b105f6e + 876ff02 commit d595d0a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

html5lib/_inputstream.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import webencodings
1010

1111
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
12-
from .constants import ReparseException
12+
from .constants import _ReparseException
1313
from . import _utils
1414

1515
from io import StringIO
@@ -530,7 +530,7 @@ def changeEncoding(self, newEncoding):
530530
self.rawStream.seek(0)
531531
self.charEncoding = (newEncoding, "certain")
532532
self.reset()
533-
raise ReparseException("Encoding changed from %s to %s" % (self.charEncoding[0], newEncoding))
533+
raise _ReparseException("Encoding changed from %s to %s" % (self.charEncoding[0], newEncoding))
534534

535535
def detectBOM(self):
536536
"""Attempts to detect at BOM at the start of the stream. If

html5lib/constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2943,5 +2943,5 @@ class DataLossWarning(UserWarning):
29432943
pass
29442944

29452945

2946-
class ReparseException(Exception):
2946+
class _ReparseException(Exception):
29472947
pass

html5lib/html5parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
adjustForeignAttributes as adjustForeignAttributesMap,
2121
adjustMathMLAttributes, adjustSVGAttributes,
2222
E,
23-
ReparseException
23+
_ReparseException
2424
)
2525

2626

@@ -83,7 +83,7 @@ def _parse(self, stream, innerHTML=False, container="div", scripting=False, **kw
8383

8484
try:
8585
self.mainLoop()
86-
except ReparseException:
86+
except _ReparseException:
8787
self.reset()
8888
self.mainLoop()
8989

0 commit comments

Comments
 (0)