Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Commit 7160485

Browse files
committed
Merge pull request #132 from robertbasic/fix/issue130
Fix/issue130. Fixes #130
2 parents d6c244e + 024b619 commit 7160485

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

pugdebug/debugger.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@ def list_breakpoints(self):
306306
def handle_listed_breakpoints(self, breakpoints):
307307
self.breakpoints_listed_signal.emit(breakpoints)
308308

309+
def get_index_file(self):
310+
if 'fileuri' in self.init_message:
311+
return self.init_message['fileuri']
312+
else:
313+
return None
314+
309315
def evaluate_expression(self, index, expression):
310316
"""Evaluates a single expression"""
311317
self.current_connection.evaluate_expression(index, expression)

pugdebug/pugdebug.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,6 @@ def open_document(self, path, map_paths=True):
298298

299299
path = self.__get_path_mapped_to_local(path, map_paths)
300300

301-
if path is False:
302-
self.handle_error(
303-
"File does not exist after mapping. "
304-
"Is the path map correct?"
305-
)
306-
self.stop_debug()
307-
return
308-
309301
if not self.documents.is_document_open(path):
310302
document_model = self.documents.open_document(path)
311303

@@ -492,6 +484,18 @@ def handle_debugging_started(self):
492484

493485
self.main_window.toggle_actions(True)
494486

487+
# Check if path to index file is correct after mapping it
488+
index_file = self.debugger.get_index_file()
489+
path = self.__get_path_mapped_to_local(index_file)
490+
491+
if path is False:
492+
self.handle_error(
493+
"File does not exist after mapping. "
494+
"Is the path map correct?"
495+
)
496+
self.stop_debug()
497+
return
498+
495499
post_start_data = {
496500
'init_breakpoints': self.init_breakpoints
497501
}

0 commit comments

Comments
 (0)