Py3 fixes

This commit is contained in:
Ruud
2014-10-06 23:02:30 +02:00
parent 6c2aef7a6d
commit ac8dbe03b2
5 changed files with 11 additions and 8 deletions
+2 -2
View File
@@ -110,7 +110,7 @@ class Event(object):
self.memoize = {}
def hash(self, handler):
return hashlib.md5(str(handler)).hexdigest()
return hashlib.md5(repr(handler).encode('utf-8')).hexdigest()
def handle(self, handler, priority = 0):
""" Registers a handler. The handler can be transmitted together
@@ -162,7 +162,7 @@ class Event(object):
t.daemon = True
t.start()
handler_keys = self.handlers.keys()
handler_keys = list(self.handlers.keys())
handler_keys.sort(key = natsortKey)
for handler in handler_keys:
+1 -2
View File
@@ -4,7 +4,6 @@
# `cssmin.py` - A Python port of the YUI CSS compressor.
from StringIO import StringIO # The pure-Python StringIO supports unicode.
import re
@@ -52,7 +51,7 @@ def remove_unnecessary_whitespace(css):
"""
Prevents 'p :link' from becoming 'p:link'.
Translates 'p :link' into 'p ___PSEUDOCLASSCOLON___link'; this is
translated back again later.
"""