Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.measure
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.measure
Commits
304bb4c3
Commit
304bb4c3
authored
11 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Python 3 compatibility
parent
18217a7c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
xbob/measure/main.cpp
+27
-3
27 additions, 3 deletions
xbob/measure/main.cpp
with
27 additions
and
3 deletions
xbob/measure/main.cpp
+
27
−
3
View file @
304bb4c3
...
...
@@ -954,7 +954,7 @@ static PyObject* roc_for_far(PyObject*, PyObject* args, PyObject* kwds) {
}
static
PyMethodDef
library
_methods
[]
=
{
static
PyMethodDef
module
_methods
[]
=
{
{
s_epc_str
,
(
PyCFunction
)
epc
,
...
...
@@ -1072,10 +1072,30 @@ static PyMethodDef library_methods[] = {
{
0
}
/* Sentinel */
};
PyDoc_STRVAR
(
module_docstr
,
"Bob metrics and performance figures"
);
#if PY_VERSION_HEX >= 0x03000000
static
PyModuleDef
module_definition
=
{
PyModuleDef_HEAD_INIT
,
XBOB_EXT_MODULE_NAME
,
module_docstr
,
-
1
,
module_methods
,
0
,
0
,
0
,
0
};
#endif
PyMODINIT_FUNC
XBOB_EXT_ENTRY_NAME
(
void
)
{
# if PY_VERSION_HEX >= 0x03000000
PyObject
*
m
=
PyModule_Create
(
&
module_definition
);
if
(
!
m
)
return
0
;
# else
PyObject
*
m
=
Py_InitModule3
(
XBOB_EXT_MODULE_NAME
,
library_methods
,
"bob::measure bindings"
);
module_methods
,
module_docstr
);
if
(
!
m
)
return
;
# endif
PyModule_AddStringConstant
(
m
,
"__version__"
,
XBOB_EXT_MODULE_VERSION
);
/* imports the NumPy C-API */
...
...
@@ -1084,4 +1104,8 @@ PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
/* imports xbob.blitz C-API */
import_xbob_blitz
();
# if PY_VERSION_HEX >= 0x03000000
return
m
;
# endif
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment