Skip to content

Commit e8e11d5

Browse files
committed
Remove further parts of six not used by Genshi.
1 parent 5cf524a commit e8e11d5

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

genshi/_six.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@
5353
spec_from_loader = None
5454

5555

56-
def _add_doc(func, doc):
57-
"""Add documentation to a function."""
58-
func.__doc__ = doc
59-
60-
6156
def _import_module(name):
6257
"""Import module, returning the module after the last dot."""
6358
__import__(name)
@@ -117,31 +112,6 @@ def __dir__(self):
117112
_moved_attributes = []
118113

119114

120-
class MovedAttribute(_LazyDescr):
121-
122-
def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
123-
super(MovedAttribute, self).__init__(name)
124-
if PY3:
125-
if new_mod is None:
126-
new_mod = name
127-
self.mod = new_mod
128-
if new_attr is None:
129-
if old_attr is None:
130-
new_attr = name
131-
else:
132-
new_attr = old_attr
133-
self.attr = new_attr
134-
else:
135-
self.mod = old_mod
136-
if old_attr is None:
137-
old_attr = name
138-
self.attr = old_attr
139-
140-
def _resolve(self):
141-
module = _import_module(self.mod)
142-
return getattr(module, self.attr)
143-
144-
145115
class _SixMetaPathImporter(object):
146116

147117
"""
@@ -243,28 +213,9 @@ class _MovedItems(_LazyModule):
243213

244214

245215
if PY3:
246-
def b(s):
247-
return s.encode("latin-1")
248-
249-
def u(s):
250-
return s
251216
unichr = chr
252-
import io
253-
StringIO = io.StringIO
254-
BytesIO = io.BytesIO
255-
del io
256217
else:
257-
def b(s):
258-
return s
259-
# Workaround for standalone backslash
260-
261-
def u(s):
262-
return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape")
263218
unichr = unichr
264-
import StringIO
265-
StringIO = BytesIO = StringIO.StringIO
266-
_add_doc(b, """Byte literal""")
267-
_add_doc(u, """Text literal""")
268219

269220

270221
if PY3:

0 commit comments

Comments
 (0)