From 4ac82eb95043a3140319f38e0d9fd8f603991836 Mon Sep 17 00:00:00 2001 From: noah morrison Date: Tue, 18 Nov 2014 12:30:44 -0500 Subject: [PATCH] Ignore python 2 specific areas in coverage coverage now ignores any lines with # python 2 in them. --- .coveragerc | 2 ++ chevron.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.coveragerc b/.coveragerc index fe258c6..376e1ab 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,5 @@ [report] exclude_lines = if __name__ == .__main__.: + + \# python 2 diff --git a/chevron.py b/chevron.py index dd2f49a..3d97b99 100755 --- a/chevron.py +++ b/chevron.py @@ -4,7 +4,7 @@ import json from sys import argv -try: +try: # python 2 unicode python3 = False except: @@ -370,12 +370,12 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache', # Add the partials output to the ouput if python3: output += part_out - else: + else: # python 2 output += part_out.decode('utf-8') if python3: return output - else: + else: # python 2 return output.encode('utf-8') -- 2.47.3