summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-09-01 17:53:42 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2022-09-01 17:53:42 +0200
commit2eafcaabbdc673576cbba8b5ab9080a2ce6d4b1e (patch)
tree04364f3be9bff558539aa7e985db099c715d6c90
parentd908a5f8328c5a16b8d60acb09583082f60f5a05 (diff)
Making esds compatible with python 3.7
-rw-r--r--esds/simulator.py2
-rw-r--r--setup.cfg2
-rwxr-xr-xtests/run.py8
3 files changed, 6 insertions, 6 deletions
diff --git a/esds/simulator.py b/esds/simulator.py
index 57dda4e..5032713 100644
--- a/esds/simulator.py
+++ b/esds/simulator.py
@@ -110,7 +110,7 @@ class Simulator:
"""
node=Node(src, self.netmat.keys())
self.nodes.append(node)
- thread=threading.Thread(target=node.run, daemon=True,args=[args])
+ thread=threading.Thread(target=node.run,args=[args]) # There must be "daemon=True" as a parameter, but we removed it to be compatible with older version of python
thread.start()
def log(self,msg,node=None):
diff --git a/setup.cfg b/setup.cfg
index 72e943a..3ed7567 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -8,4 +8,4 @@ keywords = simulator, distributed systems, cyber-physical systems, network, wire
license = GNU LGPLv3
[options]
-install_requires = numpy >= 1.22.4
+install_requires = numpy
diff --git a/tests/run.py b/tests/run.py
index e05c5b4..9c21881 100755
--- a/tests/run.py
+++ b/tests/run.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-import os, subprocess, time
+import os, subprocess, time,sys
##### Setup Variables
tests_timeout=20 # Max duration of a test
@@ -15,7 +15,7 @@ for file in os.listdir(tests_path):
print("- %-40s%s " % (file,"=>"),end='')
try:
start_at=time.time()
- out=subprocess.check_output(simulator_path, stderr=subprocess.STDOUT,timeout=tests_timeout).decode("utf-8")
+ out=subprocess.check_output([sys.executable, simulator_path], stderr=subprocess.STDOUT,timeout=tests_timeout,encoding="utf-8")
out_expected=open(out_path).read()
end_at=time.time()
if out_expected != out:
@@ -29,12 +29,12 @@ for file in os.listdir(tests_path):
except subprocess.TimeoutExpired as err:
print("failed :(")
print("------------- Test timeout (should not exceed "+str(tests_timeout)+"s) -------------")
- print(err.output.decode("utf-8"),end="")
+ print(err.output,end="")
exit(1)
except subprocess.CalledProcessError as err:
print("failed :(")
print("------------- Non test has a non-zero exit code -------------")
- print(err.output.decode("utf-8"),end="")
+ print(err.output,end="")
exit(2)
except Exception as err:
print("failed :(")