From f8b6033a3b86691470a36db57eba17d996c7d5e8 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 7 Oct 2012 16:04:31 +0200 Subject: [PATCH] Added a workaround for samefile. This fixes #600 --- flask/testsuite/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flask/testsuite/__init__.py b/flask/testsuite/__init__.py index 76a4d724..5d86fa3d 100644 --- a/flask/testsuite/__init__.py +++ b/flask/testsuite/__init__.py @@ -32,9 +32,12 @@ def add_to_path(path): raise RuntimeError('Tried to add nonexisting path') def _samefile(x, y): + if x == y: + return True try: return os.path.samefile(x, y) - except (IOError, OSError): + except (IOError, OSError, AttributeError): + # Windows has no samefile return False sys.path[:] = [x for x in sys.path if not _samefile(path, x)] sys.path.insert(0, path)