diff --git a/bindings/python/ns3modulescan-modular.py b/bindings/python/ns3modulescan-modular.py index b514cde31..40a96da0c 100644 --- a/bindings/python/ns3modulescan-modular.py +++ b/bindings/python/ns3modulescan-modular.py @@ -206,7 +206,7 @@ def scan_callback_classes(module_parser, callback_classes_file): def ns3_module_scan(top_builddir, module_name, headers_map, output_file_name, cflags): - module_parser = ModuleParser('ns.%s' % module_name, 'ns3') + module_parser = ModuleParser('ns.%s' % module_name.replace('-', '_'), 'ns3') module_parser.add_pre_scan_hook(PreScanHook(headers_map, module_name)) #module_parser.add_post_scan_hook(post_scan_hook) diff --git a/bindings/python/wscript b/bindings/python/wscript index 561d8b74d..0c9528764 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -566,7 +566,7 @@ class gen_ns3_compat_pymod_task(Task.TaskBase): 'and should not be used in newly written code", DeprecationWarning, stacklevel=2)' print >> outfile for module in self.bld.env['PYTHON_MODULES_BUILT']: - print >> outfile, "from ns.%s import *" % (module,) + print >> outfile, "from ns.%s import *" % (module.replace('-', '_')) outfile.close() return 0 diff --git a/src/wscript b/src/wscript index 5176e3153..2bb4cc73d 100644 --- a/src/wscript +++ b/src/wscript @@ -176,7 +176,7 @@ def ns3_python_bindings(bld): pymod = bld.new_task_gen(features='cxx cshlib pyext') pymod.source = ['bindings/ns3module.cc'] - pymod.target = '%s/%s' % (bld.srcnode.find_dir("bindings/python/ns").relpath_gen(bld.path), module) + pymod.target = '%s/%s' % (bld.srcnode.find_dir("bindings/python/ns").relpath_gen(bld.path), module.replace('-', '_')) pymod.name = 'ns3module_%s' % module pymod.uselib_local = "ns3" if pymod.env['ENABLE_STATIC_NS3']: