()
| 106 | |
| 107 | |
| 108 | def is_use_debugger_flag_provided(): |
| 109 | # 1. Check sys.argv directly |
| 110 | if USE_DEBUGGER_FLAG in sys.argv: |
| 111 | return True |
| 112 | |
| 113 | # 2. Check "parent-args" arguments. This is used for spawned processes such as sensors and |
| 114 | # Python runner actions |
| 115 | |
| 116 | for arg in sys.argv: |
| 117 | if arg.startswith(PARENT_ARGS_FLAG) and USE_DEBUGGER_FLAG in arg: |
| 118 | return True |
| 119 | |
| 120 | # 3. Check for ST2_USE_DEBUGGER env var |
| 121 | if os.environ.get(USE_DEBUGGER_ENV_VAR, False): |
| 122 | return True |
| 123 | |
| 124 | return False |