From ff9f827c9a695174b0cd65304b899c838ca8d13b Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 4 Mar 2017 22:51:35 -0800 Subject: [PATCH] coverage: Don't require coverage in six.PY2/PY3 branches. --- tools/coveragerc | 3 +++ zerver/lib/bugdown/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/coveragerc b/tools/coveragerc index 6fd73a2089..4d272b0dba 100644 --- a/tools/coveragerc +++ b/tools/coveragerc @@ -7,6 +7,9 @@ exclude_lines = if False: # Don't require coverage for base class NotImplementedErrors raise NotImplementedError() + # Don't require coverage for Python 2/3 variations; it's impossible to cover on both + if six.PY3: + if six.PY2: [run] omit = diff --git a/zerver/lib/bugdown/__init__.py b/zerver/lib/bugdown/__init__.py index 277cb74e5c..e553a1ec28 100644 --- a/zerver/lib/bugdown/__init__.py +++ b/zerver/lib/bugdown/__init__.py @@ -67,7 +67,7 @@ def unescape(s): # type: (Text) -> (Text) if six.PY2: return html_parser.HTMLParser().unescape(s) - else: + elif six.PY3: return html.unescape(s) def list_of_tlds():