2525"""
2626
2727
28+ import importlib .abc
2829import sys
2930from warnings import warn
3031
31- import six
32-
33- if six .PY2 :
34- import importlib
35-
36- class mock_importlib_abc (object ):
37- MetaPathFinder = object
38- Loader = object
39-
40- importlib .abc = mock_importlib_abc
41- sys .modules .setdefault ("importlib.abc" , mock_importlib_abc )
42- del mock_importlib_abc
43-
44- import importlib .abc
45-
4632WMSG = "Module {!r} is deprecated. Use {!r} instead."
4733
4834# ----------------------------------------------------------------------------
@@ -63,15 +49,6 @@ def find_spec(self, fullname, path=None, target=None):
6349 spec .loader = MapRenamedStructureModule ()
6450 return spec
6551
66- if six .PY2 :
67-
68- def find_module (self , fullname , path ):
69- # only handle submodules of diffpy.Structure
70- loader = None
71- if fullname .startswith (self .prefix ):
72- loader = MapRenamedStructureModule ()
73- return loader
74-
7552
7653# end of class FindRenamedStructureModule
7754
@@ -95,15 +72,6 @@ def create_module(self, spec):
9572 def exec_module (self , module ):
9673 return
9774
98- if six .PY2 :
99- from collections import namedtuple
100-
101- ModuleSpec = namedtuple ("ModuleSpec" , "name" )
102-
103- def load_module (self , fullname ):
104- spec = self .ModuleSpec (fullname )
105- return self .create_module (spec )
106-
10775
10876# end of class MapRenamedStructureModule
10977
0 commit comments