Просмотр исходного кода

Fixed bug in removing output file.

Tom Flucke 6 лет назад
Родитель
Сommit
05f82d2c6a
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/feature-extractor/extractor.py

+ 2 - 1
src/feature-extractor/extractor.py

@@ -85,7 +85,8 @@ def main():
     import numpy as np
     if len(np.unique([s.user for s in out])) < args.min_users:
         print("Not enough data to build valid dataset.", file=sys.stderr)
-        os.remove(args.outfile.name)
+        if os.path.isfile(args.outfile.name):
+            os.remove(args.outfile.name)
         return
     try:
         import cPickle as pickle