JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
540 stars 70 forks source link

try...except flow in run_script crashes the debugger. #117

Closed shehabattia96 closed 2 years ago

shehabattia96 commented 2 years ago

Version 0.0.16:

Try...Except doesn't catch exceptions properly when running scripts.

As far as my testing goes, this is an issue with this extension, not Blender or the Python API. Which means this extension is limiting normal python functionality.

Edit 1: There is no reason for execution to halt at every exception... wait... this makes sense now Edit 1.0.1: Thanks for being my rubber ducky here, as I was typing out the edit it made sense that it's my debugger stopping execution and not this extension. facepalm There goes an hour of fuming at why it's doing this lol image

Steps to Reproduce:

  1. Start blender using Command Pallet > Blender: Start
  2. Create a script file with a simple try...except, e.g.:

try: assert False, "Hello Blender!" except Exception as e: print(e)

3. Run the script file using Command Pallet > Blender: Run Script

**Output:**

Debugger fails at the assertion. Execution is then halted and script doesn't continue executing until the "Continue" button is pressed.

**Expected Output:**

If you run this file using:

import runpy output = runpy.run_path("path/to/script/")



You get "Hello Blender!"
shehabattia96 commented 2 years ago

Nevermind, thanks for being my rubber ducky yall, as I was typing an edit, I figured out that I had automatic breakpoints at Raised Exceptions enabled in VSCode image