From f059e8040f6d7383dc48a10819617c8cea829cf7 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Mon, 21 Dec 2020 12:43:23 -0800 Subject: [PATCH] bindings: (fixes #318) Conditionally disable deprecated functions --- src/core/bindings/modulegen_customizations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/bindings/modulegen_customizations.py b/src/core/bindings/modulegen_customizations.py index bc682710f..2e0b7d5c9 100644 --- a/src/core/bindings/modulegen_customizations.py +++ b/src/core/bindings/modulegen_customizations.py @@ -171,7 +171,9 @@ def post_register_types(root_module): root_module.classes.remove(root_module['ns3::%s' % clsname]) root_module.enums.remove(root_module['ns3::RealtimeSimulatorImpl::SynchronizationMode']) - root_module.after_init.write_code("PyEval_InitThreads();") + # Issue 318: PyEval_InitThreads deprecated after Python 3.6 + if sys.hexversion < 0x03070000: + root_module.after_init.write_code("PyEval_InitThreads();") # these are already in the main script, so commented out here # Object_customizations(root_module)