1. David Burns
  2. pytest


Benjamin Peterson  committed 6e94b18

windows kicks up a ENOENT when a part of the path is not a dir

  • Participants
  • Parent commits bbe034e
  • Branches default

Comments (0)

Files changed (1)

File _pytest/assertion/rewrite.py

View file
  • Ignore whitespace
         fp = open(pyc, "wb")
     except IOError:
-        if sys.exc_info()[1].errno == errno.ENOTDIR:
+        err = sys.exc_info()[1].errno
+        if (err == errno.ENOTDIR or
+            sys.platform == "win32" and err == errno.ENOENT):
             # This happens when we get a EEXIST in find_module creating the
             # __pycache__ directory and __pycache__ is by some non-dir node.
             return False