Giacomo Travaglini has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/30235 )
Change subject: ext: Remove dead code from helper.py
......................................................................
ext: Remove dead code from helper.py
This has been tested with vulture:
https://pypi.org/project/vulture/
Change-Id: I32aad410145dd142bba8e0b9ab912e9c2bad6001
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
---
M ext/testlib/helper.py
1 file changed, 1 insertion(+), 31 deletions(-)
diff --git a/ext/testlib/helper.py b/ext/testlib/helper.py
index 4237a76..ff83409 100644
--- a/ext/testlib/helper.py
+++ b/ext/testlib/helper.py
@@ -29,7 +29,7 @@
'''
Helper classes for writing tests with this test library.
'''
-from collections import MutableSet, OrderedDict
+from collections import MutableSet
import difflib
import errno
@@ -41,9 +41,6 @@
import tempfile
import threading
import time
-import traceback
-
-from six.moves import queue as Queue
#TODO Tear out duplicate logic from the sandbox IOManager
def log_call(logger, command, *popenargs, **kwargs):
@@ -161,7 +158,6 @@
.. note:: From cpython 3.7
'''
sentinel = object() # unique object used to signal cache
misses
- make_key = _make_key # build a key from the function arguments
cache = {}
def wrapper(*args, **kwds):
# Simple caching without ordering or size limit
@@ -350,31 +346,6 @@
list_.append(value)
dict_[key] = list_
-
-class ExceptionThread(threading.Thread):
- '''
- Wrapper around a python :class:`Thread` which will raise an
- exception on join if the child threw an unhandled exception.
- '''
- def __init__(self, *args, **kwargs):
- threading.Thread.__init__(self, *args, **kwargs)
- self._eq = Queue.Queue()
-
- def run(self, *args, **kwargs):
- try:
- threading.Thread.run(self, *args, **kwargs)
- self._eq.put(None)
- except:
- tb = traceback.format_exc()
- self._eq.put(tb)
-
- def join(self, *args, **kwargs):
- threading.Thread.join(*args, **kwargs)
- exception = self._eq.get()
- if exception:
- raise Exception(exception)
-
-
def _filter_file(fname, filters):
with open(fname, "r") as file_:
for line in file_:
@@ -397,7 +368,6 @@
Filter the given file writing filtered lines out to a temporary file,
then
copy that tempfile back into the original file.
'''
- reenter = False
(_, tfname) = tempfile.mkstemp(dir=dir, text=True)
with open(tfname, 'w') as tempfile_:
for line in _filter_file(fname, filters):
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/30235
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I32aad410145dd142bba8e0b9ab912e9c2bad6001
Gerrit-Change-Number: 30235
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s