Show More
@@ -95,13 +95,16 b' class LazyEvaluate(object):' | |||||
95 | return self.func(*self.args, **self.kwargs) |
|
95 | return self.func(*self.args, **self.kwargs) | |
96 |
|
96 | |||
97 | def __str__(self): |
|
97 | def __str__(self): | |
98 | return py3compat.cast_bytes_py2(self()) |
|
98 | s = self() | |
|
99 | if isinstance(s, unicode): | |||
|
100 | return py3compat.unicode_to_str(s) | |||
|
101 | return str(s) | |||
99 |
|
102 | |||
100 | def __unicode__(self): |
|
103 | def __unicode__(self): | |
101 |
return |
|
104 | return unicode(self()) | |
102 |
|
105 | |||
103 | def __format__(self, format_spec): |
|
106 | def __format__(self, format_spec): | |
104 | return format(unicode(self), format_spec) |
|
107 | return format(unicode(self()), format_spec) | |
105 |
|
108 | |||
106 | def multiple_replace(dict, text): |
|
109 | def multiple_replace(dict, text): | |
107 | """ Replace in 'text' all occurences of any key in the given |
|
110 | """ Replace in 'text' all occurences of any key in the given |
General Comments 0
You need to be logged in to leave comments.
Login now