fix usage for --log-level
[irker.git] / irkerhook.py
index 20ef9119dcfc677b67ba657c7def87b7011b0b02..5f15032c4e96ccf7c4e0261745aa4c54a324a370 100755 (executable)
@@ -37,7 +37,7 @@ default_channels = "irc://chat.freenode.net/#commits"
 # No user-serviceable parts below this line:
 #
 
-version = "2.0"
+version = "2.7"
 
 import os, sys, commands, socket, urllib, subprocess, locale, datetime
 from pipes import quote as shellquote
@@ -88,7 +88,8 @@ class Commit:
                     self.url = webview
             except IOError:
                 self.url = ""
-        return unicode(self.template % self.__dict__, "utf-8")
+        res = self.template % self.__dict__
+        return unicode(res, 'UTF-8') if not isinstance(res, unicode) else res
 
 class GenericExtractor:
     "Generic class for encapsulating data from a VCS."