Skip to content
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

Update pydevd_process_net_command_json.py #721

Merged
merged 3 commits into from
Sep 16, 2021
Merged

Update pydevd_process_net_command_json.py #721

merged 3 commits into from
Sep 16, 2021

Conversation

Daniel-DI
Copy link
Contributor

  • primarily, I changed the line if self._options.django_debug: to if self._options.django_debug or self._options.flask_debug:, so that if the debug option "flask": true is set, the debugger does not interrupt the program flow when the flask app is restarted due to a source file being changed. When a change in a source file is observed by the debugger, it causes a SystemExit exception with code 3, and the reloader automatically restarts the flask app.
  • the other restructuring I did was due to my interpretation that even if self._options.break_system_exit_zero is true, i.e. if the debugger interrupts the flow when the program exits with error code 0, the debugger still should not interrupt if it reloads the flask app due to a detected change in a source file.

- primarily, I changed the line `if self._options.django_debug:` to `if self._options.django_debug or self._options.flask_debug:`, so that if the debug option `"flask": true` is set, the debugger does not interrupt the program flow when the flask app is restarted due to a source file being changed. When a change in a source file is observed by the debugger, it causes a `SystemExit` exception with code `3`, and the reloader automatically restarts the flask app.
- the other restructuring I did was due to my interpretation that even if `self._options.break_system_exit_zero` is `true`, i.e. if the debugger interrupts the flow when the program exits with error code `0`, the debugger still should not interrupt if it reloads the flask app due to a detected change in a source file.
@int19h
Copy link
Collaborator

int19h commented Sep 13, 2021

@fabioz Can you take a look?

@fabioz
Copy link
Collaborator

fabioz commented Sep 14, 2021

@Daniel-DI tests seem to be failing with this change. Can you take a look at adding a test for your use-case and fixing the failing test?

@sonarcloud
Copy link

sonarcloud bot commented Sep 14, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@Daniel-DI
Copy link
Contributor Author

Daniel-DI commented Sep 14, 2021

I reverted the second change, because, as you wrote, it changes things in a way that breaks the tests as they are currently set up. I'm not versed well enough yet with tests management to "fix" those, so in the interest of simplicity and the "philosophy of small steps", i decided to undo that change.
the only change that remains is just affecting one single line, and should be self-explanatory: regarding the question of whether system exit code 3 should be ignored, both self._options.django_debug and self._options.flask_debug should be considered in the same way.

I have no idea why the tests debugpy-test-automation and debugpy-test-automation (Tests - Linux py36) fail, but from what i've read under Details, i have the impression that it's not related to my change. Not sure though.

@fabioz fabioz merged commit 5dc21d6 into microsoft:main Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants