mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Py_BuildValue(): Add "D" conversion to create a Python complex value from
a Py_complex C value. Patch by Walter Dörwald. This partially closes SF patch #407148.
This commit is contained in:
parent
521c83dd80
commit
aec79247b1
1 changed files with 6 additions and 0 deletions
|
@ -286,6 +286,12 @@ do_mkvalue(char **p_format, va_list *p_va)
|
||||||
return PyFloat_FromDouble(
|
return PyFloat_FromDouble(
|
||||||
(double)va_arg(*p_va, va_double));
|
(double)va_arg(*p_va, va_double));
|
||||||
|
|
||||||
|
#ifndef WITHOUT_COMPLEX
|
||||||
|
case 'D':
|
||||||
|
return PyComplex_FromCComplex(
|
||||||
|
*((Py_complex *)va_arg(*p_va, Py_complex *)));
|
||||||
|
#endif /* WITHOUT_COMPLEX */
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
{
|
{
|
||||||
char p[1];
|
char p[1];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue