summaryrefslogtreecommitdiffstats
path: root/SCons/Node
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2021-05-03 20:59:08 (GMT)
committerMats Wichmann <mats@linux.com>2021-05-03 21:00:29 (GMT)
commit6df6df2570b2371d8508475ff427976972f889b5 (patch)
tree851356a6d2fd94be41cbde6b7678c2775043d90c /SCons/Node
parent61cda1dfd8114a61d529a57ef37f2fc0d757a750 (diff)
downloadSCons-6df6df2570b2371d8508475ff427976972f889b5.zip
SCons-6df6df2570b2371d8508475ff427976972f889b5.tar.gz
SCons-6df6df2570b2371d8508475ff427976972f889b5.tar.bz2
Some code modernizatoion
Remove obsolete __getslice__ and __setslice_ definitions add Node.fs.scandir to call new (Py3.5) os.scandir Node.fs.makedirs now passes the exist_ok flag Cachedir creation now uses this fs.makedirs with exist_ok=True Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Node')
-rw-r--r--SCons/Node/FS.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/SCons/Node/FS.py b/SCons/Node/FS.py
index fd2f719..383a4a5 100644
--- a/SCons/Node/FS.py
+++ b/SCons/Node/FS.py
@@ -1140,10 +1140,12 @@ class LocalFS:
return os.lstat(path)
def listdir(self, path):
return os.listdir(path)
- def makedirs(self, path):
- return os.makedirs(path)
- def mkdir(self, path):
- return os.mkdir(path)
+ def scandir(self, path):
+ return os.scandir(path)
+ def makedirs(self, path, mode=0o777, exist_ok=False):
+ return os.makedirs(path, mode=mode, exist_ok=exist_ok)
+ def mkdir(self, path, mode=0o777):
+ return os.mkdir(path, mode=mode)
def rename(self, old, new):
return os.rename(old, new)
def stat(self, path):