scons,python,sim: Eliminate a redundant member of EmbeddedPython.

The filename member was just a less specific version of the abspath
member, and can be replaced by it to simplify things a little.

Change-Id: I61b312f2c356045e03462159e3232ac717954669
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48365
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Gabe Black
2021-07-17 05:11:45 -07:00
parent 95f9017c2e
commit 1253c15ebe
4 changed files with 12 additions and 18 deletions

View File

@@ -363,16 +363,14 @@ class PySource(SourceFile):
assert ext == '.py'
if package:
path = package.split('.')
modpath = package.split('.')
else:
path = []
modpath = []
modpath = path[:]
if modname != '__init__':
modpath += [ modname ]
modpath = '.'.join(modpath)
arcpath = path + [ basename ]
abspath = self.snode.abspath
if not os.path.exists(abspath):
abspath = self.tnode.abspath
@@ -380,7 +378,6 @@ class PySource(SourceFile):
self.package = package
self.modname = modname
self.modpath = modpath
self.arcname = os.path.join(*arcpath)
self.abspath = abspath
self.cpp = File(self.filename + '.cc')
@@ -1235,7 +1232,6 @@ namespace
# into a global list.
code('''
EmbeddedPython embedded_module_info(
${{c_str(pysource.arcname)}},
${{c_str(pysource.abspath)}},
${{c_str(pysource.modpath)}},
embedded_module_data,