Skip to content

Commit

Permalink
fix relative import for py3
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov committed Dec 23, 2015
1 parent 1b3ed26 commit d590152
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions kociemba/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ class SlowContextWarning(Warning):

try:
import os
from ckociembawrapper import ffi, lib
from .ckociembawrapper import ffi, lib
cache_dir = os.path.join(os.path.dirname(__file__), 'cprunetables')

def _solve(s):
res = lib.solve(s.encode('utf-8'), cache_dir.encode('utf-8'))
if res != ffi.NULL:
return ffi.string(res).strip()
return ffi.string(res).strip().decode('utf-8')
else:
raise ValueError('Error. Probably cubestring is invalid')
except ImportError:
except ImportError as e:
print(e)
warnings.warn("Native version of the package is not available. "
"We have to fallback to pure-Python implementation of "
"the algorithm, which is usually many times slower. "
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='kociemba',
version='1.0.1',
version='1.0.2',
description='Python/C implementation of Herbert Kociemba\'s Two-Phase algorithm for solving Rubik\'s Cube',
keywords='kociemba rubik cube solver twophase',
url='https://github.com/muodov/kociemba',
Expand Down

0 comments on commit d590152

Please sign in to comment.