summaryrefslogtreecommitdiffstats
path: root/src/if_py_both.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-24 21:21:58 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-24 21:21:58 +0200
commitc1c3d68da9d5a089949e8687b8783daf7ee2d416 (patch)
tree821b913401e6c3e8361e1fc7335b09c3f8f94b3a /src/if_py_both.h
parentd5e376eb3b11dbeca5478724731399d6c23c74a6 (diff)
updated for version 7.3.1239v7.3.1239
Problem: Can't build with Python and MSVC10. Solution: Move #if outside of macro. (Taro Muraoka)
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r--src/if_py_both.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 4f977c38c2..d66e2cbd19 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -139,13 +139,15 @@ StringToChars(PyObject *obj, PyObject **todecref)
}
else
{
- PyErr_FORMAT(PyExc_TypeError,
#if PY_MAJOR_VERSION < 3
- N_("expected str() or unicode() instance, but got %s")
+ PyErr_FORMAT(PyExc_TypeError,
+ N_("expected str() or unicode() instance, but got %s"),
+ Py_TYPE_NAME(obj));
#else
- N_("expected bytes() or str() instance, but got %s")
+ PyErr_FORMAT(PyExc_TypeError,
+ N_("expected bytes() or str() instance, but got %s"),
+ Py_TYPE_NAME(obj));
#endif
- , Py_TYPE_NAME(obj));
return NULL;
}
@@ -191,15 +193,17 @@ NumberToLong(PyObject *obj, long *result, int flags)
}
else
{
- PyErr_FORMAT(PyExc_TypeError,
#if PY_MAJOR_VERSION < 3
+ PyErr_FORMAT(PyExc_TypeError,
N_("expected int(), long() or something supporting "
- "coercing to long(), but got %s")
+ "coercing to long(), but got %s"),
+ Py_TYPE_NAME(obj));
#else
+ PyErr_FORMAT(PyExc_TypeError,
N_("expected int() or something supporting coercing to int(), "
- "but got %s")
+ "but got %s"),
+ Py_TYPE_NAME(obj));
#endif
- , Py_TYPE_NAME(obj));
return -1;
}