Commit 28af3827 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Convert these to getStaticString

parent 86a995bc
......@@ -321,7 +321,7 @@ static PyObject* abstract_get_bases(PyObject* cls) noexcept {
static PyObject* __bases__ = NULL;
if (__bases__ == NULL) {
__bases__ = PyString_InternFromString("__bases__");
__bases__ = getStaticString("__bases__");
if (__bases__ == NULL)
return NULL;
}
......@@ -394,7 +394,7 @@ static int recursive_isinstance(PyObject* inst, PyObject* cls) noexcept {
static PyObject* __class__ = NULL;
if (__class__ == NULL) {
__class__ = PyString_InternFromString("__class__");
__class__ = getStaticString("__class__");
if (__class__ == NULL)
return -1;
}
......@@ -2156,7 +2156,7 @@ extern "C" PyObject* _PyNumber_ConvertIntegralToInt(PyObject* integral, const ch
const char* type_name;
static PyObject* int_name = NULL;
if (int_name == NULL) {
int_name = PyString_InternFromString("__int__");
int_name = getStaticString("__int__");
if (int_name == NULL)
return NULL;
}
......@@ -2287,7 +2287,7 @@ extern "C" PyObject* PyNumber_Long(PyObject* o) noexcept {
Py_ssize_t buffer_len;
if (trunc_name == NULL) {
trunc_name = PyString_InternFromString("__trunc__");
trunc_name = getStaticString("__trunc__");
if (trunc_name == NULL)
return NULL;
}
......
......@@ -328,7 +328,7 @@ extern "C" PyObject* PyObject_Unicode(PyObject* v) noexcept {
/* We're an instance of a classic class */
/* Try __unicode__ from the instance -- alas we have no type */
if (!unicodestr) {
unicodestr = PyString_InternFromString("__unicode__");
unicodestr = getStaticString("__unicode__");
if (!unicodestr)
return NULL;
}
......
......@@ -173,7 +173,7 @@ Box* min_max(Box* arg0, BoxedTuple* args, BoxedDict* kwargs, int opid) {
Box* extremVal;
if (kwargs && kwargs->d.size()) {
static BoxedString* key_str = static_cast<BoxedString*>(PyString_InternFromString("key"));
static BoxedString* key_str = static_cast<BoxedString*>(getStaticString("key"));
auto it = kwargs->d.find(key_str);
if (it != kwargs->d.end() && kwargs->d.size() == 1) {
key_func = it->second;
......
......@@ -1044,7 +1044,7 @@ static PyObject* half_binop(PyObject* v, PyObject* w, char* opname, binaryfunc t
}
if (coerce_obj == NULL) {
coerce_obj = PyString_InternFromString("__coerce__");
coerce_obj = getStaticString("__coerce__");
if (coerce_obj == NULL)
return NULL;
}
......
......@@ -36,7 +36,7 @@ static PyObject* try_complex_special_method(PyObject* op) noexcept {
static PyObject* complexstr;
if (complexstr == NULL) {
complexstr = PyString_InternFromString("__complex__");
complexstr = getStaticString("__complex__");
if (complexstr == NULL)
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment