diff --git a/feedgen/__main__.py b/feedgen/__main__.py index 24fd463..4463ea6 100644 --- a/feedgen/__main__.py +++ b/feedgen/__main__.py @@ -15,7 +15,10 @@ def print_enc(s): '''Print function compatible with both python2 and python3 accepting strings and byte arrays. ''' - print(s.decode('utf-8') if type(s) == type(b'') else s) + if sys.version_info[0] >= 3: + print(s.decode('utf-8') if type(s) == type(b'') else s) + else: + print(s)