Return the compiler-flags associated with the future features that have been imported into the given namespace (globs).
(globs)
| 201 | ###################################################################### |
| 202 | |
| 203 | def _extract_future_flags(globs): |
| 204 | """ |
| 205 | Return the compiler-flags associated with the future features that |
| 206 | have been imported into the given namespace (globs). |
| 207 | """ |
| 208 | flags = 0 |
| 209 | for fname in __future__.all_feature_names: |
| 210 | feature = globs.get(fname, None) |
| 211 | if feature is getattr(__future__, fname): |
| 212 | flags |= feature.compiler_flag |
| 213 | return flags |
| 214 | |
| 215 | def _normalize_module(module, depth=2): |
| 216 | """ |