bindings: (fixes #796) Gracefully exit when bindings are unavailable
This commit is contained in:
@@ -51,7 +51,14 @@
|
||||
# +----------------+ +----------------+
|
||||
#
|
||||
|
||||
from ns import ns
|
||||
try:
|
||||
from ns import ns
|
||||
except ModuleNotFoundError:
|
||||
raise SystemExit(
|
||||
"Error: ns3 Python module not found;"
|
||||
" Python bindings may not be enabled"
|
||||
" or your PYTHONPATH might not be properly configured"
|
||||
)
|
||||
|
||||
# #
|
||||
# # This function will be used below as a trace sink
|
||||
|
||||
@@ -22,7 +22,14 @@
|
||||
|
||||
import sys
|
||||
|
||||
from ns import ns
|
||||
try:
|
||||
from ns import ns
|
||||
except ModuleNotFoundError:
|
||||
raise SystemExit(
|
||||
"Error: ns3 Python module not found;"
|
||||
" Python bindings may not be enabled"
|
||||
" or your PYTHONPATH might not be properly configured"
|
||||
)
|
||||
|
||||
# void
|
||||
# DevTxTrace (std::string context, Ptr<const Packet> p, Mac48Address address)
|
||||
|
||||
Reference in New Issue
Block a user