|
|
@@ -68,7 +68,7 @@ class NilmDB(object): |
|
|
|
# Create the database path if it doesn't exist |
|
|
|
try: |
|
|
|
os.makedirs(self.basepath) |
|
|
|
except OSError, e: |
|
|
|
except OSError as e: |
|
|
|
if e.errno != errno.EEXIST: |
|
|
|
raise IOError("can't create tree " + self.basepath) |
|
|
|
|
|
|
@@ -174,7 +174,7 @@ class NilmDB(object): |
|
|
|
index = [ "timestamp" ] |
|
|
|
for ind in index: |
|
|
|
table.cols._f_col(ind).createIndex() |
|
|
|
except KeyError, e: |
|
|
|
except KeyError as e: |
|
|
|
# Remove this table if we got an error |
|
|
|
self.h5file.removeNode(group, node) |
|
|
|
raise e |
|
|
|