summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2018-12-28 03:01:58 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2019-01-21 02:00:04 +0000
commitfe915ac461ea4e2f13e8a204809e1b4dd095ddd2 (patch)
tree2ae435525b53f013744f9bae61cc5bb2e20bc47f
parent15cba69a20498f91ef0d144817f36614dc24fcbc (diff)
downloadpsycopg2-fe915ac461ea4e2f13e8a204809e1b4dd095ddd2.tar.gz
Bytes_Format: use a couple of macros instead of functions
The type was already checked upstream in the func body.
-rw-r--r--psycopg/bytes_format.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/psycopg/bytes_format.c b/psycopg/bytes_format.c
index 1289914..c11b1b7 100644
--- a/psycopg/bytes_format.c
+++ b/psycopg/bytes_format.c
@@ -123,7 +123,7 @@ Bytes_Format(PyObject *format, PyObject *args)
result = Bytes_FromStringAndSize((char *)NULL, reslen);
if (result == NULL)
return NULL;
- res = Bytes_AsString(result);
+ res = Bytes_AS_STRING(result);
if (PyTuple_Check(args)) {
arglen = PyTuple_GET_SIZE(args);
argidx = 0;
@@ -238,8 +238,7 @@ Bytes_Format(PyObject *format, PyObject *args)
"unsupported format character '%c' (0x%x) "
"at index " FORMAT_CODE_PY_SSIZE_T,
c, c,
- (Py_ssize_t)(fmt - 1 -
- Bytes_AsString(format)));
+ (Py_ssize_t)(fmt - 1 - Bytes_AS_STRING(format)));
goto error;
}
if (width < len)