Commit 9d7b2c0
* Properly handle SyntaxErrors in Python source files.
SyntaxErrors in the target module will rise normally, while SyntaxErrors in dependencies will be added to badmodules. This includes a new regression test.
* Fix name collision bug.
This fixes an issue where a "fromlist" import with the same name as a previously failed import would be incorrectly added to badmodules. This includes a new regression test.
* Replace mutable default values.
Bound empty lists have been replaced with the "if param is None" idiom.
* Replace deprecated imp usage.
Constants imported from imp have been moved to private module-level constants, and ModuleFinder.find_module has been refactored to use importlib. Other than an improvement on how frozen builtin imports are reported (as the frozen imports they are, rather than the stdlib modules they *may* have originated from), these changes maintain complete compatibility with past versions... including odd behavior for returning relative (below current directory, but not a C extension) vs. absolute (above current directory, or a C extension) paths.
Patch by Brandt Bucher.
1 parent 2dad960 commit 9d7b2c0
6 files changed
Lines changed: 116 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
| |||
43 | 51 | | |
44 | 52 | | |
45 | 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 | + | |
46 | 102 | | |
47 | 103 | | |
48 | 104 | | |
| |||
69 | 125 | | |
70 | 126 | | |
71 | 127 | | |
72 | | - | |
| 128 | + | |
73 | 129 | | |
74 | 130 | | |
75 | 131 | | |
76 | 132 | | |
77 | 133 | | |
78 | 134 | | |
79 | 135 | | |
80 | | - | |
81 | | - | |
| 136 | + | |
| 137 | + | |
82 | 138 | | |
83 | 139 | | |
84 | 140 | | |
| |||
105 | 161 | | |
106 | 162 | | |
107 | 163 | | |
108 | | - | |
| 164 | + | |
109 | 165 | | |
110 | 166 | | |
111 | 167 | | |
112 | 168 | | |
113 | 169 | | |
114 | 170 | | |
115 | | - | |
| 171 | + | |
116 | 172 | | |
117 | 173 | | |
118 | 174 | | |
| |||
279 | 335 | | |
280 | 336 | | |
281 | 337 | | |
282 | | - | |
| 338 | + | |
283 | 339 | | |
284 | 340 | | |
285 | 341 | | |
286 | | - | |
| 342 | + | |
287 | 343 | | |
288 | | - | |
| 344 | + | |
289 | 345 | | |
290 | 346 | | |
291 | 347 | | |
| |||
323 | 379 | | |
324 | 380 | | |
325 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
326 | 385 | | |
327 | 386 | | |
328 | 387 | | |
329 | | - | |
330 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
331 | 391 | | |
332 | 392 | | |
333 | 393 | | |
334 | 394 | | |
335 | 395 | | |
336 | | - | |
337 | 396 | | |
338 | 397 | | |
339 | 398 | | |
| |||
445 | 504 | | |
446 | 505 | | |
447 | 506 | | |
448 | | - | |
| 507 | + | |
449 | 508 | | |
450 | 509 | | |
451 | | - | |
| 510 | + | |
| 511 | + | |
452 | 512 | | |
453 | 513 | | |
454 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
221 | 248 | | |
222 | 249 | | |
223 | 250 | | |
| |||
299 | 326 | | |
300 | 327 | | |
301 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
302 | 335 | | |
303 | 336 | | |
304 | 337 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments