| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
- Naming: sqlite3ErrName => pysqlite_error_name
- Error handling:
* return NULL if no exception matched
* receiver handles errors
* don't use error table to store SQLITE_UNKNOWN string
- Use intermingled declarations - Simplify ref count handling
- Declutter add_error_constants() - No need to typedef struct - Simplify naming - Use PyModule_AddIntConstant
To avoid mismatch between char *name and constant
IMO, we should not pollute the SQLITE_* namespace
- Use correct attribute name - Normalise error variable naming - Remove 'Errno' from printed string to avoid confusion
- Use assertRaisesRegex iso. two assert functions - Normalise quotes - Test that constants are added to the module
|
cc. @auvipy & @matrixise who reviewed the original PR. |
Sorry, something went wrong.
|
FYI, I pushed a small tweak to the unit test: use the temp_dir helper iso. a hard coded path. Thanks for reviewing, @auvipy |
Sorry, something went wrong.
| int | ||
| _pysqlite_seterror(pysqlite_state *state, sqlite3 *db) | ||
| static PyObject * | ||
| get_exception_class(pysqlite_state *state, int errorcode) |
There was a problem hiding this comment.
This is slighly confusing because normally returning NULL signifies an error. Could you please document this both on the call site and in this function? Otherwise the call site reads weirdly because
PyObject *exc_class = get_exception_class(state, errorcode);
if (exc_class == NULL) {
return errorcode;
}
seems that is handling an error
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, I see now that it can be a bit confusing. I'll add a comment. Thanks!
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Good work!
Sorry, something went wrong.
|
Thanks Pablo, and you can thank @danielshahaf & @palaviv for the good work; I just "stole" it, rebased onto main and made some minor adjustments :) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Original PR: GH-1108 (contributed by @palaviv, based on patches by @danielshahaf)
This PR is a rebase and rework of Aviv & Daniel's work.
Co-authored-by: Aviv Pavlivoda
Co-authored-by: Daniel Shahaf
Co-authored-by: Erlend E. Aasland
https://bugs.python.org/issue16379