소스 검색

Fixed bug in removing output file.

Tom Flucke 6 년 전
부모
커밋
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