- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 131
Remove special case for strings in pydevd_sys_monitoring #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -143,6 +143,28 @@ def has_binding(api): | |
| return check_version(mod.__version__, "1.0.3") | ||
| else: | ||
| return True | ||
|  | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was a fix for qt loading that somebody submitted to debugpy | ||
| except ModuleNotFoundError: | ||
| from importlib import machinery | ||
|  | ||
| # importing top level PyQt4/PySide module is ok... | ||
| mod = __import__(module_name) | ||
|  | ||
| # ...importing submodules is not | ||
| loader_details = (machinery.ExtensionFileLoader, machinery.EXTENSION_SUFFIXES) | ||
| submod_finder = machinery.FileFinder(mod.__path__[0], loader_details) | ||
| submod_check = ( | ||
| submod_finder.find_spec("QtCore") is not None | ||
| and submod_finder.find_spec("QtGui") is not None | ||
| and submod_finder.find_spec("QtSvg") is not None | ||
| ) | ||
|  | ||
| # we can also safely check PySide version | ||
| if api == QT_API_PYSIDE: | ||
| return check_version(mod.__version__, '1.0.3') and submod_check | ||
| else: | ||
| return submod_check | ||
|  | ||
| except ImportError: | ||
| return False | ||
|  | ||
|  | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -1073,17 +1073,6 @@ def get_file_type(self, frame, abs_real_path_and_basename=None, _cache_file_type | |
| return _cache_file_type[cache_key] | ||
| except: | ||
| if abs_real_path_and_basename[0] == "<string>": | ||
| # TODO: This isn't ideal. We should make it so that "<string>" is | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need this anymore after eliminating the internal lambda in  | ||
| # never marked as pydevd (i.e.: investigate all the use cases | ||
| # where pydevd does this and actually mark it as "<pydevd-string>") | ||
|  | ||
| # Consider it an untraceable file unless there's no back frame (ignoring | ||
| # internal files and runpy.py). | ||
| if frame.f_back is not None and self.get_file_type(frame.f_back) == self.PYDEV_FILE: | ||
| # Special case, this is a string coming from pydevd itself. However we have to skip this logic for other | ||
| # files that are also marked as PYDEV_FILE (like external files marked this way) | ||
| return self.PYDEV_FILE | ||
|  | ||
| f = frame.f_back | ||
| while f is not None: | ||
| if self.get_file_type(f) != self.PYDEV_FILE and pydevd_file_utils.basename(f.f_code.co_filename) not in ( | ||
|  | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -5739,26 +5739,6 @@ def test_stop_on_entry2(case_setup_dap): | |
| writer.finished_ok = True | ||
|  | ||
|  | ||
| def test_stop_on_entry_verify_strings(case_setup_dap): | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test doesn't work anymore since there's no longer a special case for pydevd strings. | ||
| with case_setup_dap.test_file("not_my_code/main_on_entry3.py") as writer: | ||
| json_facade = JsonFacade(writer) | ||
| json_facade.write_set_debugger_property([], ["main_on_entry3.py", "_pydevd_string_breakpoint.py"]) | ||
| json_facade.write_launch( | ||
| justMyCode=True, | ||
| stopOnEntry=True, | ||
| showReturnValue=True, | ||
| rules=[ | ||
| {"path": "**/main_on_entry3.py", "include": False}, | ||
| {"path": "**/_pydevd_string_breakpoint.py", "include": False}, | ||
| ], | ||
| ) | ||
|  | ||
| json_facade.write_make_initial_run() | ||
| json_facade.wait_for_thread_stopped("breakpoint", file="empty_file.py") | ||
| json_facade.write_continue() | ||
| writer.finished_ok = True | ||
|  | ||
|  | ||
| @pytest.mark.parametrize("val", [True, False]) | ||
| def test_debug_options(case_setup_dap, val): | ||
| with case_setup_dap.test_file("_debugger_case_debug_options.py") as writer: | ||
|  | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor fixes I noticed when debugging.