source expression Try to get source code for the given object and display it.
(self, arg)
| 2231 | do_ll = do_longlist |
| 2232 | |
| 2233 | def do_source(self, arg): |
| 2234 | """source expression |
| 2235 | |
| 2236 | Try to get source code for the given object and display it. |
| 2237 | """ |
| 2238 | if not arg: |
| 2239 | self._print_invalid_arg(arg) |
| 2240 | return |
| 2241 | try: |
| 2242 | obj = self._getval(arg) |
| 2243 | except: |
| 2244 | return |
| 2245 | try: |
| 2246 | lines, lineno = self._getsourcelines(obj) |
| 2247 | except (OSError, TypeError) as err: |
| 2248 | self.error(err) |
| 2249 | return |
| 2250 | self._print_lines(lines, lineno) |
| 2251 | |
| 2252 | complete_source = _complete_expression |
| 2253 |
nothing calls this directly
no test coverage detected