Gabe Black has submitted this change. ( 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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48126
Reviewed-by: Daniel Carvalho <oda...@yahoo.com.br>
Reviewed-by: Bobby R. Bruce <bbr...@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbr...@ucdavis.edu>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/SConscript
1 file changed, 11 insertions(+), 12 deletions(-)

Approvals:
  Daniel Carvalho: Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/SConscript b/src/SConscript
index c8a35b8..0cf361a 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)



2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
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: 4
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
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

Reply via email to