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