Show More
@@ -31,8 +31,22 b' else:' | |||
|
31 | 31 | |
|
32 | 32 | if sys.version_info[0] >= 3: |
|
33 | 33 | import builtins |
|
34 | import functools | |
|
34 | 35 | builtins.xrange = range |
|
35 | 36 | |
|
37 | def _wrapattrfunc(f): | |
|
38 | @functools.wraps(f) | |
|
39 | def w(object, name, *args): | |
|
40 | if isinstance(name, bytes): | |
|
41 | name = name.decode(u'utf-8') | |
|
42 | return f(object, name, *args) | |
|
43 | return w | |
|
44 | ||
|
45 | delattr = _wrapattrfunc(builtins.delattr) | |
|
46 | getattr = _wrapattrfunc(builtins.getattr) | |
|
47 | hasattr = _wrapattrfunc(builtins.hasattr) | |
|
48 | setattr = _wrapattrfunc(builtins.setattr) | |
|
49 | ||
|
36 | 50 | stringio = io.StringIO |
|
37 | 51 | empty = _queue.Empty |
|
38 | 52 | queue = _queue.Queue |
General Comments 0
You need to be logged in to leave comments.
Login now