diff options
author | Chris Small <chsmall22@gmail.com> | 2014-11-25 11:39:03 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-11-25 11:39:03 +0900 |
commit | 6a133b0cacbac79d5b99e363a076b26bf316dd62 (patch) | |
tree | 7bb83beefd6bebc81e4540e380853068228d21a2 | |
parent | 007d5adc0e358f4740380998eaa96e82233999f3 (diff) |
Workaround of os.path.samefile
os.path.samrfile not implemented on Windows. Adding alternative using
os.stat
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/utils.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ryu/utils.py b/ryu/utils.py index f0d2e3a9..78e7a098 100644 --- a/ryu/utils.py +++ b/ryu/utils.py @@ -48,8 +48,13 @@ def chop_py_suffix(p): def _likely_same(a, b): try: - if os.path.samefile(a, b): - return True + # Samefile not availible on windows + if sys.platform == 'win32': + if os.stat(a) == os.stat(b): + return True + else: + if os.path.samefile(a, b): + return True except OSError: # m.__file__ is not always accessible. eg. egg return False |