Permalink
Browse files

Fixed for python 3

  • Loading branch information...
1 parent 43ee79e commit ef08c118f0b99245a0ce69a17be4d3fe025694f5 @adisbladis adisbladis committed Oct 20, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 pjson
View
7 pjson
@@ -21,7 +21,8 @@ Author: Igor Guerrero <igfgt1@gmail.com>, 2012
import json
import sys
-from StringIO import StringIO
+try: from StringIO import StringIO
+except ImportError: from io import StringIO
from pygments import highlight
from pygments.formatters import TerminalFormatter
from pygments.lexers import JSONLexer
@@ -47,7 +48,7 @@ if __name__ == '__main__':
for line in sys.stdin:
code = format_json_code(line)
if sys.stdout.isatty():
- print color_yo_shit(code)
+ print(color_yo_shit(code))
else:
- print code
+ print(code)

0 comments on commit ef08c11

Please sign in to comment.