You've already forked gnatcoll-bindings
mirror of
https://github.com/AdaCore/gnatcoll-bindings.git
synced 2026-02-12 12:59:11 -08:00
Add support for python unicode objects.
The previous hack was that PyString_Check also returns True for unicode objects, but then the functions PyString_AsString always returned NULL for a unicode object. So now PyString_Check only returns true for strings, and a new function PyUnicode_Check was added. (PyBaseString_Check): new function, with the old behavior of PyString_Check (PyUnicode_*): new functions For K616-011 git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@175218 936e1b1b-40f2-da11-902a-00137254ae57
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*-------------------------------------------------------------------
|
||||
G P S --
|
||||
--
|
||||
Copyright (C) 2003-2010, AdaCore --
|
||||
Copyright (C) 2003-2011, AdaCore --
|
||||
--
|
||||
GPS is free software; you can redistribute it and/or modify it --
|
||||
under the terms of the GNU General Public License as published by --
|
||||
@@ -114,11 +114,23 @@ ada_py_xdecref (PyObject* obj)
|
||||
}
|
||||
|
||||
int
|
||||
ada_pystring_check (PyObject* obj)
|
||||
ada_pybasestring_check (PyObject* obj)
|
||||
{
|
||||
return PyString_Check (obj) || PyUnicode_Check (obj);
|
||||
}
|
||||
|
||||
int
|
||||
ada_pystring_check (PyObject* obj)
|
||||
{
|
||||
return PyString_Check (obj);
|
||||
}
|
||||
|
||||
int
|
||||
ada_pyunicode_check (PyObject* obj)
|
||||
{
|
||||
return PyUnicode_Check (obj);
|
||||
}
|
||||
|
||||
int
|
||||
ada_pyint_check (PyObject* obj)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user