From 2147b2d0cf2dccee0e7cdabf85595e6ebfded849 Mon Sep 17 00:00:00 2001
From: tr1cks
Date: Wed, 15 Mar 2017 17:35:39 +0500
Subject: [PATCH] Fix bug with import IDL by absolute path in Windows.
---
thriftpy/parser/parser.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thriftpy/parser/parser.py b/thriftpy/parser/parser.py
index f65320a..bcb0f50 100644
--- a/thriftpy/parser/parser.py
+++ b/thriftpy/parser/parser.py
@@ -539,7 +539,7 @@ def parse(path, module_name=None, include_dirs=None, include_dir=None,
if url_scheme == 'file':
with open(urlparse(path).netloc + urlparse(path).path) as fh:
data = fh.read()
- elif url_scheme == '':
+ elif url_scheme == '' or os.path.exists(path):
with open(path) as fh:
data = fh.read()
elif url_scheme in ('http', 'https'):