I've applied the following patch.

Chris says:

When trying out ryu under windows (and Python 2.7) I ran into a error
because os.path.samefile is not implemented. I did a quick workaround
in ryu/utils.py to use the os.stat(file) output instead if on the
"win32" platform.

Change seems to allow application to run on Windows and change built
clean on Travis.

https://github.com/osrg/ryu/pull/28

Thanks a lot!

=
>From 6a133b0cacbac79d5b99e363a076b26bf316dd62 Mon Sep 17 00:00:00 2001
From: Chris Small <[email protected]>
Date: Tue, 25 Nov 2014 11:39:03 +0900
Subject: [PATCH] Workaround of os.path.samefile

os.path.samrfile not implemented on Windows. Adding alternative using
os.stat

Signed-off-by: FUJITA Tomonori <[email protected]>
---
 ryu/utils.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ryu/utils.py b/ryu/utils.py
index f0d2e3a..78e7a09 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
-- 
1.9.3 (Apple Git-50)


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to