mod.{subname} = submod
(mod, submod, fullname, subname)
| 207 | return m |
| 208 | |
| 209 | def add_submodule(mod, submod, fullname, subname): |
| 210 | """mod.{subname} = submod""" |
| 211 | if mod is None: |
| 212 | return #Nothing to do here. |
| 213 | |
| 214 | if submod is None: |
| 215 | submod = sys.modules[fullname] |
| 216 | |
| 217 | setattr(mod, subname, submod) |
| 218 | |
| 219 | return |
| 220 | |
| 221 | def ensure_fromlist(mod, fromlist, buf, recursive): |
| 222 | """Handle 'from module import a, b, c' imports.""" |