summaryrefslogtreecommitdiffstats
path: root/reduce.py
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-02-17 13:49:25 +0800
committerPeng Wu <alexepico@gmail.com>2013-02-17 13:49:25 +0800
commit7c0c65b93bb34af5582aa3ed8f27c53fe5266b23 (patch)
tree6529b9c9d2dcc59aabb080cda211a139da43806f /reduce.py
parentc141d3e1e827d2fba968e83e55dfbfbedc967c1b (diff)
downloadtrainer-7c0c65b93bb34af5582aa3ed8f27c53fe5266b23.zip
trainer-7c0c65b93bb34af5582aa3ed8f27c53fe5266b23.tar.gz
trainer-7c0c65b93bb34af5582aa3ed8f27c53fe5266b23.tar.xz
make python2 happy
Diffstat (limited to 'reduce.py')
-rwxr-xr-xreduce.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/reduce.py b/reduce.py
index 0aed817..4e096f2 100755
--- a/reduce.py
+++ b/reduce.py
@@ -29,7 +29,8 @@ def iterateSubDirectory(oldroot, newroot, level):
#Merge the index in oldroot
if level <= 0:
newindex = newroot + config.getIndexPostfix()
- os.makedirs(os.path.dirname(newindex), exist_ok=True)
+ dirname = os.path.dirname(newindex)
+ os.path.exists(dirname) or os.makedirs(dirname)
newindexfile = open(newindex, 'a')
mergeSubIndex(newindexfile, oldroot)
newindexfile.close()