Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/48126 )
Change subject: scons: Use the os.path prefix when using components of that
module.
......................................................................
scons: Use the os.path prefix when using components of that module.
That makes it obvious where the methods involved are coming from. Also
some of the imported names weren't being used.
Change-Id: I6ec75eef1e5ea9eae51e7df675e477dccb351bd1
---
M src/SConscript
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/src/SConscript b/src/SConscript
index f20a0d6..a323828 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -48,8 +48,6 @@
import sys
import zlib
-from os.path import dirname, exists, isdir, isfile, join as joinpath
-
import SCons
from gem5_scons import Transform, warning, error
@@ -327,7 +325,7 @@
'''
blob_path = os.path.abspath(blob_path)
blob_out_dir = os.path.join(env['BUILDDIR'], 'blobs')
- path_noext = joinpath(blob_out_dir, symbol)
+ path_noext = os.path.join(blob_out_dir, symbol)
cpp_path = path_noext + '.cc'
hpp_path = path_noext + '.hh'
def embedBlob(target, source, env):
@@ -348,7 +346,7 @@
Source(cpp_path)
def GdbXml(xml_id, symbol):
- Blob(joinpath(gdb_xml_dir, xml_id), symbol)
+ Blob(os.path.join(gdb_xml_dir, xml_id), symbol)
class Source(SourceFile):
pass
@@ -380,13 +378,13 @@
arcpath = path + [ basename ]
abspath = self.snode.abspath
- if not exists(abspath):
+ if not os.path.exists(abspath):
abspath = self.tnode.abspath
self.package = package
self.modname = modname
self.modpath = modpath
- self.arcname = joinpath(*arcpath)
+ self.arcname = os.path.join(*arcpath)
self.abspath = abspath
self.compiled = File(self.filename + 'c')
self.cpp = File(self.filename + '.cc')
@@ -688,15 +686,16 @@
continue
if 'SConscript' in files:
- build_dir = joinpath(env['BUILDDIR'], root[len(base_dir) + 1:])
- SConscript(joinpath(root, 'SConscript'), variant_dir=build_dir)
+ build_dir = os.path.join(env['BUILDDIR'], root[len(base_dir) + 1:])
+ SConscript(os.path.join(root, 'SConscript'), variant_dir=build_dir)
for extra_dir in extras_dir_list:
- prefix_len = len(dirname(extra_dir)) + 1
+ prefix_len = len(os.path.dirname(extra_dir)) + 1
# Also add the corresponding build directory to pick up generated
# include files.
- env.Append(CPPPATH=Dir(joinpath(env['BUILDDIR'],
extra_dir[prefix_len:])))
+ env.Append(CPPPATH=Dir(os.path.join(env['BUILDDIR'],
+ extra_dir[prefix_len:])))
for root, dirs, files in os.walk(extra_dir, topdown=True):
# if build lives in the extras directory, don't walk down it
@@ -704,8 +703,8 @@
dirs.remove('build')
if 'SConscript' in files:
- build_dir = joinpath(env['BUILDDIR'], root[prefix_len:])
- SConscript(joinpath(root, 'SConscript'), variant_dir=build_dir)
+ build_dir = os.path.join(env['BUILDDIR'], root[prefix_len:])
+ SConscript(os.path.join(root, 'SConscript'),
variant_dir=build_dir)
for opt in export_vars:
env.ConfigFile(opt)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48126
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: I6ec75eef1e5ea9eae51e7df675e477dccb351bd1
Gerrit-Change-Number: 48126
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s