Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
On non-Windows systems: things stay as they are
On windows system: it would pass the path to the thrift file with "file://" scheme.
If ThriftPY is fixed to handle the 'file' scheme - things would work on windows.
Until then, things will stay broken, as they are now.

This is further discussed here: python-happybase#148
and here:  Thriftpy/thriftpy#269

NOTE: I created a corresponding fork and pull request on thrifypy as well:
 Thriftpy/thriftpy#270
  • Loading branch information
ErKatz authored Dec 6, 2016
1 parent 2a3f51e commit fe12e3c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion happybase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@

import pkg_resources as _pkg_resources
import thriftpy as _thriftpy
_thriftpy.load(
import platform

if platform.system()=="Windows":
_thriftpy.load(
'file://'+_pkg_resources.resource_filename('happybase', 'Hbase.thrift'),
'Hbase_thrift')
else:
_thriftpy.load(
_pkg_resources.resource_filename('happybase', 'Hbase.thrift'),
'Hbase_thrift')

Expand Down

0 comments on commit fe12e3c

Please sign in to comment.