summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2019-04-15 13:15:03 +0200
committerChristian Heimes <christian@python.org>2019-04-15 13:15:03 +0200
commit4888e1fe2fb25984907f918de442eb5c2f983fa1 (patch)
treeb8e94ee12f87bd3b9d386dd1226dbb218bd7c1fb
parent39d8e8876eb47e6326b8a56dc28bcde62b457b9c (diff)
downloaddefusedxml-git-4888e1fe2fb25984907f918de442eb5c2f983fa1.tar.gz
Mark some lines as non-reachable
-rw-r--r--defusedxml/ElementTree.py2
-rw-r--r--defusedxml/common.py2
-rw-r--r--defusedxml/expatbuilder.py2
-rw-r--r--defusedxml/expatreader.py2
-rw-r--r--defusedxml/xmlrpc.py10
5 files changed, 9 insertions, 9 deletions
diff --git a/defusedxml/ElementTree.py b/defusedxml/ElementTree.py
index f9e2032..b1504e4 100644
--- a/defusedxml/ElementTree.py
+++ b/defusedxml/ElementTree.py
@@ -114,7 +114,7 @@ class DefusedXMLParser(_XMLParser):
def defused_unparsed_entity_decl(self, name, base, sysid, pubid, notation_name):
# expat 1.2
- raise EntitiesForbidden(name, None, base, sysid, pubid, notation_name)
+ raise EntitiesForbidden(name, None, base, sysid, pubid, notation_name) # pragma: no cover
def defused_external_entity_ref_handler(self, context, base, sysid, pubid):
raise ExternalReferenceForbidden(context, base, sysid, pubid)
diff --git a/defusedxml/common.py b/defusedxml/common.py
index 9dcdc5a..7e4bb0b 100644
--- a/defusedxml/common.py
+++ b/defusedxml/common.py
@@ -12,7 +12,7 @@ PY3 = sys.version_info[0] == 3
# Fail early when pyexpat is not installed correctly
if not hasattr(xml.parsers.expat, "ParserCreate"):
- raise ImportError("pyexpat")
+ raise ImportError("pyexpat") # pragma: no cover
class DefusedXmlException(ValueError):
diff --git a/defusedxml/expatbuilder.py b/defusedxml/expatbuilder.py
index ab743d2..7bfc57e 100644
--- a/defusedxml/expatbuilder.py
+++ b/defusedxml/expatbuilder.py
@@ -36,7 +36,7 @@ class DefusedExpatBuilder(_ExpatBuilder):
def defused_unparsed_entity_decl(self, name, base, sysid, pubid, notation_name):
# expat 1.2
- raise EntitiesForbidden(name, None, base, sysid, pubid, notation_name)
+ raise EntitiesForbidden(name, None, base, sysid, pubid, notation_name) # pragma: no cover
def defused_external_entity_ref_handler(self, context, base, sysid, pubid):
raise ExternalReferenceForbidden(context, base, sysid, pubid)
diff --git a/defusedxml/expatreader.py b/defusedxml/expatreader.py
index 198588f..890e1d1 100644
--- a/defusedxml/expatreader.py
+++ b/defusedxml/expatreader.py
@@ -40,7 +40,7 @@ class DefusedExpatParser(_ExpatParser):
def defused_unparsed_entity_decl(self, name, base, sysid, pubid, notation_name):
# expat 1.2
- raise EntitiesForbidden(name, None, base, sysid, pubid, notation_name)
+ raise EntitiesForbidden(name, None, base, sysid, pubid, notation_name) # pragma: no cover
def defused_external_entity_ref_handler(self, context, base, sysid, pubid):
raise ExternalReferenceForbidden(context, base, sysid, pubid)
diff --git a/defusedxml/xmlrpc.py b/defusedxml/xmlrpc.py
index 3569167..fbc674d 100644
--- a/defusedxml/xmlrpc.py
+++ b/defusedxml/xmlrpc.py
@@ -31,7 +31,7 @@ else:
try:
import gzip
-except ImportError:
+except ImportError: # pragma: no cover
gzip = None
@@ -47,7 +47,7 @@ def defused_gzip_decode(data, limit=None):
Decode data using the gzip content encoding as described in RFC 1952
"""
- if not gzip:
+ if not gzip: # pragma: no cover
raise NotImplementedError
if limit is None:
limit = MAX_DATA
@@ -58,7 +58,7 @@ def defused_gzip_decode(data, limit=None):
decoded = gzf.read()
else:
decoded = gzf.read(limit + 1)
- except IOError:
+ except IOError: # pragma: no cover
raise ValueError("invalid data")
f.close()
gzf.close()
@@ -75,7 +75,7 @@ class DefusedGzipDecodedResponse(gzip.GzipFile if gzip else object):
def __init__(self, response, limit=None):
# response doesn't support tell() and read(), required by
# GzipFile
- if not gzip:
+ if not gzip: # pragma: no cover
raise NotImplementedError
self.limit = limit = limit if limit is not None else MAX_DATA
if limit < 0: # no limit
@@ -131,7 +131,7 @@ class DefusedExpatParser(ExpatParser):
def defused_unparsed_entity_decl(self, name, base, sysid, pubid, notation_name):
# expat 1.2
- raise EntitiesForbidden(name, None, base, sysid, pubid, notation_name)
+ raise EntitiesForbidden(name, None, base, sysid, pubid, notation_name) # pragma: no cover
def defused_external_entity_ref_handler(self, context, base, sysid, pubid):
raise ExternalReferenceForbidden(context, base, sysid, pubid)