(self, co)
| 582 | return missing, maybe |
| 583 | |
| 584 | def replace_paths_in_code(self, co): |
| 585 | new_filename = original_filename = os.path.normpath(co.co_filename) |
| 586 | for f, r in self.replace_paths: |
| 587 | if original_filename.startswith(f): |
| 588 | new_filename = r + original_filename[len(f):] |
| 589 | break |
| 590 | |
| 591 | if self.debug and original_filename not in self.processed_paths: |
| 592 | if new_filename != original_filename: |
| 593 | self.msgout(2, "co_filename %r changed to %r" \ |
| 594 | % (original_filename,new_filename,)) |
| 595 | else: |
| 596 | self.msgout(2, "co_filename %r remains unchanged" \ |
| 597 | % (original_filename,)) |
| 598 | self.processed_paths.append(original_filename) |
| 599 | |
| 600 | consts = list(co.co_consts) |
| 601 | for i in range(len(consts)): |
| 602 | if isinstance(consts[i], type(co)): |
| 603 | consts[i] = self.replace_paths_in_code(consts[i]) |
| 604 | |
| 605 | return co.replace(co_consts=tuple(consts), co_filename=new_filename) |
| 606 | |
| 607 | |
| 608 | def test(): |
no test coverage detected