()
| 341 | |
| 342 | |
| 343 | def run_file(): |
| 344 | target = options.target |
| 345 | start_debugging(target) |
| 346 | |
| 347 | # run_path has one difference with invoking Python from command-line: |
| 348 | # if the target is a file (rather than a directory), it does not add its |
| 349 | # parent directory to sys.path. Thus, importing other modules from the |
| 350 | # same directory is broken unless sys.path is patched here. |
| 351 | |
| 352 | if target is not None and os.path.isfile(target): |
| 353 | dir = os.path.dirname(target) |
| 354 | sys.path.insert(0, dir) |
| 355 | else: |
| 356 | log.debug("Not a file: {0!r}", target) |
| 357 | |
| 358 | log.describe_environment("Pre-launch environment:") |
| 359 | |
| 360 | log.info("Running file {0!r}", target) |
| 361 | runpy.run_path(target, run_name="__main__") |
| 362 | |
| 363 | |
| 364 | def run_module(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…