From: noah morrison Date: Tue, 18 Nov 2014 17:30:44 +0000 (-0500) Subject: Ignore python 2 specific areas in coverage X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=4ac82eb95043a3140319f38e0d9fd8f603991836;p=chevron.git Ignore python 2 specific areas in coverage coverage now ignores any lines with # python 2 in them. --- 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')