History

python/lib/gen_pyobject.py: prepare for python3 (see #33)

Paul Brossier committed 10 years ago

Commit ade36e61 parent 7ffb5541 file · +6 −6Browse files

Showing the changes to python/lib (1 of 1 file). Show all

Unified · Split

python/lib/gen_pyobject.py+6−6
@@ -150,7 +150,7 @@ aubio2pytypes = { · 149 unmodified lines
150150 aubiovecfrompyobj = {
151151 'fvec_t*': 'PyAubio_ArrayToCFvec',
152152 'cvec_t*': 'PyAubio_ArrayToCCvec',
153− 'uint_t': '(uint_t)PyInt_AsLong',
153+ 'uint_t': '(uint_t)PyLong_AsLong',
154154 }
155155
156156 # aubio to python
@@ -158,8 +158,8 @@ aubiovectopyobj = { · 1 unmodified line
158158 'fvec_t*': 'PyAubio_CFvecToArray',
159159 'cvec_t*': 'PyAubio_CCvecToPyCvec',
160160 'smpl_t': 'PyFloat_FromDouble',
161− 'uint_t*': 'PyInt_FromLong',
162− 'uint_t': 'PyInt_FromLong',
161+ 'uint_t*': 'PyLong_FromLong',
162+ 'uint_t': 'PyLong_FromLong',
163163 }
164164
165165 def gen_new_init(newfunc, name):
@@ -171,7 +171,7 @@ def gen_new_init(newfunc, name): · 5 unmodified lines
171171 selfparams = ''
172172 # "param1", "param2", "param3"
173173 paramnames = ", ".join(["\""+p['name']+"\"" for p in newparams])
174− pyparams = "".join(map(lambda p: aubio2pytypes[p['type']], newparams))
174+ pyparams = "".join([aubio2pytypes[p['type']] for p in newparams])
175175 paramrefs = ", ".join(["&" + p['name'] for p in newparams])
176176 s = """\
177177 // WARNING: this file is generated, DO NOT EDIT
@@ -288,7 +288,7 @@ def gen_do_input_params(inputparams): · 110 unmodified lines
288288 inputdefs += " PyObject * " + p['name'] + "_obj;\n"
289289
290290 inputvecs = " /* input vectors prototypes */\n "
291− inputvecs += "\n ".join(map(lambda p: p['type'] + ' ' + p['name'] + ";", inputparams))
291+ inputvecs += "\n ".join([ p['type'] + ' ' + p['name'] + ";" for p in inputparams])
292292
293293 parseinput = " /* input vectors parsing */\n "
294294 for p in inputparams:
@@ -362,7 +362,7 @@ def gen_do(dofunc, name): · 67 unmodified lines
362362
363363 n_param = len(doparams)
364364
365− if name in param_numbers.keys():
365+ if name in list(param_numbers.keys()):
366366 n_input_param, n_output_param = param_numbers[name]
367367 else:
368368 n_input_param, n_output_param = 1, n_param - 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t