Skip to content

Commit

Permalink
Python 3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
magmax committed May 27, 2014
1 parent cd415a8 commit 2d935b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions colorize/colorize.py
Expand Up @@ -121,10 +121,10 @@ def __init__(self, fdin, regexps):
def run(self):
while not self.fdin.closed:
line = self.fdin.readline()
if line == '':
break
if isinstance(line, bytes):
line = line.decode('utf-8')
if line == '':
break
print(self.replace(line.rstrip()))

def replace(self, line):
Expand Down

0 comments on commit 2d935b5

Please sign in to comment.