Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 703490 Details for
Bug 857875
write callback: No safe way to signal user abort
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
a script exercising python-to-C int/long conversions
pnum.c (text/plain), 1.49 KB, created by
Kamil Dudka
on 2013-02-27 15:25:52 UTC
(
hide
)
Description:
a script exercising python-to-C int/long conversions
Filename:
MIME Type:
Creator:
Kamil Dudka
Created:
2013-02-27 15:25:52 UTC
Size:
1.49 KB
patch
obsolete
>#if 0 >gcc "$0" $(python-config --cflags) $(python-config --ldflags) -shared -fPIC -o pnum.so || exit $? >echo >python -c ' >import pnum >import sys >def chk(x): > print(x) > return pnum.xxx(x) > >chk(None) >chk(0) >chk(-1) >i = 1 >while chk(i): > i = i * 0x100 >' >exit $? >#endif >#include <Python.h> >#include <stdio.h> > >PyObject* xxx(PyObject *self, PyObject *args) >{ > PyObject *obj; > PyArg_ParseTuple(args, "O", &obj); > if (PyErr_Occurred()) { > PyErr_Print(); > Py_INCREF(Py_False); > return Py_False; > } > > printf("PyLong_Check() = %d\n", PyLong_Check(obj)); >#if PY_MAJOR_VERSION < 3 > printf("PyInt_Check() = %d\n", PyInt_Check(obj)); > > const long li = PyLong_AsLong(obj); > printf("PyInt_AsLong() = 0x%lx ", li); > if (PyErr_Occurred()) > PyErr_Print(); > else > puts(""); >#endif > > const long ll = PyLong_AsLong(obj); > printf("PyLong_AsLong() = 0x%lx ", ll); > if (PyErr_Occurred()) { > PyErr_Print(); > puts(""); > Py_INCREF(Py_False); > return Py_False; > } > else { > puts("\n"); > Py_INCREF(Py_True); > return Py_True; > } >} > >PyMethodDef pnum_methods[] = { > {"xxx", xxx, METH_VARARGS}, > {NULL, NULL}, >}; > >#if PY_MAJOR_VERSION < 3 >void initpnum() >{ > (void)Py_InitModule("pnum", pnum_methods); >} >#else >static PyModuleDef pnum_mod = { > PyModuleDef_HEAD_INIT, "pycurl", "", -1, > pnum_methods, NULL, NULL, NULL, NULL >}; > >PyMODINIT_FUNC PyInit_pnum(void) >{ > PyModule_Create(&pnum_mod); >} >#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 857875
:
613627
|
658097
|
703018
|
703490
|
703505
|
703527
|
705949