Commit 4835c13
authored
Fix _is_on_pypi to check response content instead of just catching exceptions (#45933)
PyPIClient.project() returns {'message': 'Not Found'} for non-existent
packages without raising an exception. The _is_on_pypi function only
checked for exceptions, so it incorrectly treated all packages as already
registered on PyPI, preventing name reservation for new packages like
azure-mgmt-appnetwork.
Fix: check for 'info' key in the response, which is only present for
valid PyPI projects.1 parent 8a5c833 commit 4835c13
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments