22contents (think minification, compression).
33"""
44
5- from __future__ import with_statement
6-
75import os
86import subprocess
97import inspect
108import shlex
119import tempfile
1210import pkgutil
1311from webassets import six
14- from webassets .six .moves import map
15- from webassets .six .moves import zip
1612try :
1713 frozenset
1814except NameError :
@@ -34,7 +30,7 @@ def freezedicts(obj):
3430 if isinstance (obj , (list , tuple )):
3531 return type (obj )([freezedicts (sub ) for sub in obj ])
3632 if isinstance (obj , dict ):
37- return frozenset (six . iteritems ( obj ))
33+ return frozenset (obj . items ( ))
3834 return obj
3935
4036
@@ -50,19 +46,11 @@ def smartsplit(string, sep):
5046 be done.
5147 """
5248 assert string is not None # or shlex will read from stdin
53- if not six .PY3 :
54- # On 2.6, shlex fails miserably with unicode input
55- is_unicode = isinstance (string , unicode )
56- if is_unicode :
57- string = string .encode ('utf8' )
5849 l = shlex .shlex (string , posix = True )
5950 l .whitespace += ','
6051 l .whitespace_split = True
6152 l .quotes = ''
62- if not six .PY3 and is_unicode :
63- return map (lambda s : s .decode ('utf8' ), list (l ))
64- else :
65- return list (l )
53+ return list (l )
6654
6755
6856class option (tuple ):
@@ -204,9 +192,6 @@ def get_config(self, setting=False, env=None, require=True,
204192 if value is None and not env is False :
205193 value = os .environ .get (env )
206194 if value is not None :
207- if not six .PY3 :
208- # TODO: What charset should we use? What does Python 3 use?
209- value = value .decode ('utf8' )
210195 if type == list :
211196 value = smartsplit (value , ',' )
212197
@@ -620,7 +605,7 @@ def get_filter(f, *args, **kwargs):
620605 # Don't need to do anything.
621606 assert not args and not kwargs
622607 return f
623- elif isinstance (f , six . string_types ):
608+ elif isinstance (f , str ):
624609 if f in _FILTERS :
625610 klass = _FILTERS [f ]
626611 else :
0 commit comments