File tree Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change 7
7
import tempfile
8
8
9
9
from codecs import BOM_UTF8
10
+ from pkgutil import iter_modules
10
11
from types import CodeType , FunctionType
11
12
from types import ModuleType
12
13
13
14
from couchdb import json , util
14
15
from couchdb .server .exceptions import Error , FatalError , Forbidden
15
16
16
- try :
17
- from pkgutil import iter_modules
18
- except ImportError :
19
- try :
20
- # Python 2.4
21
- from pkg_resources import get_importer , zipimport
22
-
23
- def iter_modules (paths ):
24
- for path in paths :
25
- loader = get_importer (path )
26
- if not isinstance (loader , zipimport .zipimporter ):
27
- continue
28
- names = loader .get_data ('EGG-INFO/top_level.txt' )
29
- for name in names .split ('\n ' )[:- 1 ]:
30
- yield loader , name , None
31
- except ImportError :
32
- get_importer = None
33
- iter_modules = None
34
- zipimport = None
35
-
36
17
__all__ = ['compile_func' , 'require' , 'DEFAULT_CONTEXT' ]
37
18
38
19
log = logging .getLogger (__name__ )
You can’t perform that action at this time.
0 commit comments