Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a66f79

Browse filesBrowse files
committed
Fix segfault on Python 2.
1 parent f188e0f commit 5a66f79
Copy full SHA for 5a66f79

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎_mysql.c

Copy file name to clipboardExpand all lines: _mysql.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ _mysql_escape_string(
10751075
#else
10761076
check_server_init(NULL);
10771077

1078-
if (PyModule_Check((PyObject*)self))
1078+
if (self && PyModule_Check((PyObject*)self))
10791079
self = NULL;
10801080
if (self && self->open)
10811081
len = mysql_real_escape_string(&(self->connection), out, in, size);
@@ -1104,7 +1104,7 @@ _mysql_string_literal(
11041104
PyObject *str, *s, *o, *d;
11051105
char *in, *out;
11061106
int len, size;
1107-
if (PyModule_Check((PyObject*)self))
1107+
if (self && PyModule_Check((PyObject*)self))
11081108
self = NULL;
11091109
if (!PyArg_ParseTuple(args, "O|O:string_literal", &o, &d)) return NULL;
11101110
if (PyBytes_Check(o)) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.