fix: replace bare except with except Exception in pytree init#18744
fix: replace bare except with except Exception in pytree init#18744harshadkhetpal wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18744
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New Failures, 2 Unrelated FailuresAs of commit 8c1f79c with merge base b9a6b84 ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @harshadkhetpal! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
This PR needs a
|
|
Hi @harshadkhetpal, please sign the CLA and clear the failing checks (also in #18484) |
Summary
Replace bare
except:withexcept Exception:inextension/pytree/__init__.py.Bare
except:catches all exceptions includingSystemExit,KeyboardInterrupt, andGeneratorExit, which should not be silently caught. Since this handler only logs and falls back to torch pytree on import failure, catchingExceptionis the correct scope.Change:
Testing
No behavior change — the import fallback logic is preserved.