Commit 247945210cf4bf0a7c3aacc13a3a5f2f696e08b3
1 parent
6ab7c6ed
Fix exception handling SWIG interface for Python 2
Showing
1 changed file
with
4 additions
and
4 deletions
pyext/GTestSuite.i
| ... | ... | @@ -69,11 +69,11 @@ public: |
| 69 | 69 | "utf-8", |
| 70 | 70 | "Error ~"); |
| 71 | 71 | if (temp_bytes != NULL) { |
| 72 | - c_type = PyBytes_AS_STRING(temp_bytes); | |
| 72 | + c_type = PyString_AsString(temp_bytes); | |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | else if (py_type != NULL) { |
| 76 | - c_type = PyBytes_AS_STRING(py_type); | |
| 76 | + c_type = PyString_AsString(py_type); | |
| 77 | 77 | } |
| 78 | 78 | if (c_type != NULL) { |
| 79 | 79 | m_message += std::string(c_type); |
| ... | ... | @@ -84,11 +84,11 @@ public: |
| 84 | 84 | "utf-8", |
| 85 | 85 | "Error ~"); |
| 86 | 86 | if (temp_bytes != NULL) { |
| 87 | - c_value = PyBytes_AS_STRING(temp_bytes); | |
| 87 | + c_value = PyString_AsString(temp_bytes); | |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | else if (py_value != NULL) { |
| 91 | - c_value = PyBytes_AS_STRING(py_value); | |
| 91 | + c_value = PyString_AsString(py_value); | |
| 92 | 92 | } |
| 93 | 93 | if (c_value != NULL) { |
| 94 | 94 | m_message += std::string(c_value); | ... | ... |