(self, exc_type, exc_val, exc_tb)
| 33 | return self |
| 34 | |
| 35 | def __exit__(self, exc_type, exc_val, exc_tb): |
| 36 | if exc_type is not None: |
| 37 | if exc_type == DebuggerInitializationError: |
| 38 | return False # It's already an error we generated. |
| 39 | |
| 40 | # We couldn't even import it... |
| 41 | found_at = find_in_pythonpath(self.import_name) |
| 42 | |
| 43 | if len(found_at) <= 1: |
| 44 | # It wasn't found anywhere or there was just 1 occurrence. |
| 45 | # Let's just return to show the original error. |
| 46 | return False |
| 47 | |
| 48 | # We found more than 1 occurrence of the same module in the PYTHONPATH |
| 49 | # (the user module and the standard library module). |
| 50 | # Let's notify the user as it seems that the module was shadowed. |
| 51 | msg = self._generate_shadowed_import_message(found_at) |
| 52 | raise DebuggerInitializationError(msg) |
| 53 | |
| 54 | def _generate_shadowed_import_message(self, found_at): |
| 55 | msg = """It was not possible to initialize the debugger due to a module name conflict. |
nothing calls this directly
no test coverage detected