shithub: aubio

Download patch

ref: 61e9d991d6f303acbbba7ba8c71fa6af531c9d24
parent: 2410f57abba7b61c883824567bd034e723e3d574
author: Paul Brossier <piem@piem.org>
date: Wed Oct 31 21:08:50 EDT 2018

[py] simplify import in gen_external.py

--- a/python/lib/gen_external.py
+++ b/python/lib/gen_external.py
@@ -3,6 +3,8 @@
 import os
 import subprocess
 import glob
+from distutils.sysconfig import customize_compiler
+from gen_code import MappedObject
 
 header = os.path.join('src', 'aubio.h')
 output_path = os.path.join('python', 'gen')
@@ -49,7 +51,6 @@
 
 def get_preprocessor():
     # findout which compiler to use
-    from distutils.sysconfig import customize_compiler
     compiler_name = distutils.ccompiler.get_default_compiler()
     compiler = distutils.ccompiler.new_compiler(compiler=compiler_name)
     try:
@@ -262,10 +263,6 @@
     # print_c_declarations_results(lib, c_declarations)
 
     sources_list = []
-    try:
-        from .gen_code import MappedObject
-    except (SystemError, ValueError):
-        from gen_code import MappedObject
     for o in lib:
         out = source_header
         mapped = MappedObject(lib[o], usedouble=usedouble)