Commits

Jakub Wilk  committed e729ce4

Fix argument decoding for Python 3.

  • Participants
  • Parent commits 84a9d24

Comments (0)

Files changed (1)

     options = ArgumentParser().parse_args()
     encoding = locale.getpreferredencoding()
     if options.term:
-        term = options.term.decode(encoding)
+        term = options.term
+        if not isinstance(term, unicode):
+            term = term.decode(encoding)
         matcher = re.compile(term, re.UNICODE | re.IGNORECASE | re.DOTALL).search
     else:
         matcher = id