diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-09-01 09:11:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-01 09:11:43 (GMT) |
commit | eb8974616bc58f44b2a3c3e4ca2326894ae42c8f (patch) | |
tree | 8b33d94a0ca263a5260703d1299fe54ab90d48c2 /Lib/xml/sax | |
parent | 41c57b335330ff48af098d47e379e0f9ba09d233 (diff) | |
download | cpython-eb8974616bc58f44b2a3c3e4ca2326894ae42c8f.zip cpython-eb8974616bc58f44b2a3c3e4ca2326894ae42c8f.tar.gz cpython-eb8974616bc58f44b2a3c3e4ca2326894ae42c8f.tar.bz2 |
bpo-15999: Always pass bool instead of int to the expat parser. (GH-15622)
Diffstat (limited to 'Lib/xml/sax')
-rw-r--r-- | Lib/xml/sax/expatreader.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py index 5066ffc..e334ac9 100644 --- a/Lib/xml/sax/expatreader.py +++ b/Lib/xml/sax/expatreader.py @@ -93,7 +93,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): self._parser = None self._namespaces = namespaceHandling self._lex_handler_prop = None - self._parsing = 0 + self._parsing = False self._entity_stack = [] self._external_ges = 0 self._interning = None @@ -203,10 +203,10 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): # IncrementalParser methods - def feed(self, data, isFinal = 0): + def feed(self, data, isFinal=False): if not self._parsing: self.reset() - self._parsing = 1 + self._parsing = True self._cont_handler.startDocument() try: @@ -237,13 +237,13 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): # If we are completing an external entity, do nothing here return try: - self.feed("", isFinal = 1) + self.feed(b"", isFinal=True) self._cont_handler.endDocument() - self._parsing = 0 + self._parsing = False # break cycle created by expat handlers pointing to our methods self._parser = None finally: - self._parsing = 0 + self._parsing = False if self._parser is not None: # Keep ErrorColumnNumber and ErrorLineNumber after closing. parser = _ClosedParser() @@ -307,7 +307,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): self._parser.SetParamEntityParsing( expat.XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE) - self._parsing = 0 + self._parsing = False self._entity_stack = [] # Locator methods |