tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Q\¬Qc@s=ddlZddlZddlZddlZddlZddlmZyeWn!e    k
rwddl
m ZnXddl Z ej ƒZeejjejƒgZdddddgdgd    gd
gZdddddd gdgd    gd gZddd ddddgdggdgZdddddddd ddg    dggdgZdd ddd ddddddddg ggdgZddddd ddddddd dd!g ggd"gZdddgd#ggd$gZd%„Zd&„Zd'ejfd(„ƒYZd)„Zed*kr9ej ƒndS(+iÿÿÿÿN(t test_support(tSetsa.moduletatsystbtcs b.somethingsÊa/__init__.py
a/module.py
                                from b import something
                                from c import something
b/__init__.py
                                from sys import *
t
__future__sa/__init__.py
a/module.py
                                from b import something
                                from c import something
b/__init__.py
                                from __future__ import absolute_import
                                from sys import *
sa.bsa.ctmymoduletblahblahsmymodule.py
a/__init__.py
                                import blahblah
                                from a import b
                                import c
a/module.py
                                import sys
                                from a import b as x
                                from a.c import sillyname
a/b.py
a/c.py
                                from a.module import x
                                import mymodule as sillyname
                                from sys import version_info
sb.xsb.ysb.zt
exceptionss‚mymodule.py
a/__init__.py
a/module.py
                                from __future__ import absolute_import
                                import sys # sys
                                import blahblah # fails
                                import exceptions # exceptions
                                import b.x # b.x
                                from b import y # b.y
                                from b.z import * # b.z.*
a/exceptions.py
a/sys.py
                                import mymodule
a/b/__init__.py
a/b/x.py
a/b/y.py
a/b/z.py
b/__init__.py
                                import z
b/unused.py
b/x.py
b/y.py
b/z.py
sa.b.ysa.b.zsa.b.cs a.b.c.moduleCsa.b.c.dsa.b.c.esa.b.xs¿mymodule.py
a/__init__.py
                                from .b import y, z # a.b.y, a.b.z
a/module.py
                                from __future__ import absolute_import # __future__
                                import exceptions # exceptions
a/exceptions.py
a/sys.py
a/b/__init__.py
                                from ..b import x # a.b.x
                                #from a.b.c import moduleC
                                from .c import moduleC # a.b.moduleC
a/b/x.py
a/b/y.py
a/b/z.py
a/b/g.py
a/b/c/__init__.py
                                from ..c import e # a.b.c.e
a/b/c/moduleC.py
                                from ..c import d # a.b.c.d
a/b/c/d.py
a/b/c/e.py
a/b/c/x.py
sa.syssa.b.c.fs    a.anothersÐmymodule.py
a/__init__.py
                                from . import sys # a.sys
a/another.py
a/module.py
                                from .b import y, z # a.b.y, a.b.z
a/exceptions.py
a/sys.py
a/b/__init__.py
                                from .c import moduleC # a.b.c.moduleC
                                from .c import d # a.b.c.d
a/b/x.py
a/b/y.py
a/b/z.py
a/b/c/__init__.py
                                from . import e # a.b.c.e
a/b/c/moduleC.py
                                #
                                from . import f   # a.b.c.f
                                from .. import x  # a.b.x
                                from ... import another # a.another
a/b/c/d.py
a/b/c/e.py
a/b/c/f.py
sa.bars®a/__init__.py
                                def foo(): pass
a/module.py
                                from . import foo
                                from . import bar
cCs/tjj|ƒ}tjj|ƒt|dƒS(Ntw(tostpathtdirnamet    distutilstdir_utiltmkpathtopen(R R ((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyt    open_fileÎscCs¨d}z‡x€|jƒD]r}|jdƒs:|jdƒrT|j|jƒdƒq|rg|jƒnttjj    t
|jƒƒƒ}qWWd|r£|jƒnXdS(Nt s    s
( tNonet
splitlinest
startswithtwritetstriptcloseRR R tjointTEST_DIR(tsourcetofitline((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pytcreate_packageÔs )tModuleFinderTestcBsheZed„Zd„Zd„Zeedd    ƒrfd„Z    d„Z
d„Z d„Z d„Z nRS(
cCsü|\}}}}}t|ƒzÅtjdtƒ}|j|ƒ|rT|jƒnt|ƒ}t|jjƒƒ}    t    |    |ƒ}
t    ||    ƒ} |j
|
| fggfƒ|j ƒ\} } |j
| |ƒ|j
| |ƒWdt j jtƒXdS(NR (Rt modulefindert ModuleFindert    TEST_PATHt import_hooktreporttsettmodulestkeystlistt assertEqualtany_missing_maybeRRt remove_treeR(tselftinfoR%t import_thisR'tmissingt maybe_missingRtmftfoundtmoretlesstbadtmaybe((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyt_do_testãs 
 
cCs|jtƒdS(N(R8t package_test(R-((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyt test_packagescCs|jtƒdS(N(R8t
maybe_test(R-((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyt
test_maybestabsolute_importcCs|jtƒdS(N(R8tmaybe_test_new(R-((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyttest_maybe_new
scCs|jtƒdS(N(R8tabsolute_import_test(R-((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyttest_absolute_imports scCs|jtƒdS(N(R8trelative_import_test(R-((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyttest_relative_importsscCs|jtƒdS(N(R8trelative_import_test_2(R-((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyttest_relative_imports_2scCs|jtƒdS(N(R8trelative_import_test_3(R-((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyttest_relative_imports_3sN(t__name__t
__module__tFalseR8R:R<tgetattrRRR?RARCRERG(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyR âs                         cCs'tjjtjjƒtjtƒdS(N(Rtlogt set_thresholdtWARNRt run_unittestR (((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyt    test_mainst__main__(!RR tunittesttdistutils.dir_utilRttempfilettestRR&t    NameErrortsetsRR!tmkdtempRR R t__file__R#R;R>R9R@RBRDRFRRtTestCaseR RPRHtmain(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_modulefinder.pyt<module>s‚                                                                                   7