Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ _PyLocals_GetKind(PyObject *kinds, int i)
{
assert(PyBytes_Check(kinds));
assert(0 <= i && i < PyBytes_GET_SIZE(kinds));
char *ptr = PyBytes_AS_STRING(kinds);
const char *ptr = PyBytes_AS_STRING(kinds);
return (_PyLocals_Kind)(ptr[i]);
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/_sqlite/blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ subscript_slice(pysqlite_Blob *self, PyObject *item)
}
char *res_buf = PyBytesWriter_GetData(writer);

char *blob_buf = PyBytes_AS_STRING(blob);
const char *blob_buf = PyBytes_AS_STRING(blob);
for (Py_ssize_t i = 0, j = 0; i < len; i++, j += step) {
res_buf[i] = blob_buf[j];
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,7 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
(in particular, numeric IP addresses). */
struct maybe_idna {
PyObject *obj;
char *buf;
const char *buf;
};

static void
Expand Down
2 changes: 1 addition & 1 deletion Objects/stringlib/codecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ STRINGLIB(utf8_encoder)(PyObject *unicode,
writer->overallocate = (newpos < size);
}

char *rep_str;
const char *rep_str;
Py_ssize_t rep_len;
if (PyBytes_Check(rep)) {
rep_str = PyBytes_AS_STRING(rep);
Expand Down
2 changes: 1 addition & 1 deletion Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -7314,7 +7314,7 @@ unicode_encode_ucs1(PyObject *unicode,
writer->overallocate = (newpos < size);
}

char *rep_str;
const char *rep_str;
Py_ssize_t rep_len;
if (PyBytes_Check(rep)) {
/* Directly copy bytes result to output. */
Expand Down
4 changes: 2 additions & 2 deletions Parser/action_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ expr_ty _PyPegen_decoded_constant_from_token(Parser* p, Token* tok) {
}

expr_ty _PyPegen_constant_from_token(Parser* p, Token* tok) {
char* bstr = PyBytes_AsString(tok->bytes);
const char* bstr = PyBytes_AsString(tok->bytes);
if (bstr == NULL) {
return NULL;
}
Expand All @@ -1499,7 +1499,7 @@ expr_ty _PyPegen_constant_from_token(Parser* p, Token* tok) {
}

expr_ty _PyPegen_constant_from_string(Parser* p, Token* tok) {
char* the_str = PyBytes_AsString(tok->bytes);
const char* the_str = PyBytes_AsString(tok->bytes);
if (the_str == NULL) {
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion Parser/string_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ warn_invalid_escape_sequence(Parser *p, const char* buffer, const char *first_in
char first_quote = 0;
if (lineno == t->lineno) {
int quote_count = 0;
char* tok = PyBytes_AsString(t->bytes);
const char* tok = PyBytes_AsString(t->bytes);
for (int i = 0; i < PyBytes_Size(t->bytes); i++) {
if (tok[i] == '\'' || tok[i] == '\"') {
if (quote_count == 0) {
Expand Down
Loading