Skip to content

Commit acedcf7

Browse files
committed
updated hbase_compact_tables.py
1 parent 165e025 commit acedcf7

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

hbase_compact_tables.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,15 @@
4242
try:
4343
# pylint: disable=wrong-import-position
4444
import happybase # pylint: disable=unused-import
45-
# weird this is only importable after happybase, must global implicit import
4645
# happybase.hbase.ttypes.IOError no longer there in Happybase 1.0
47-
from Hbase_thrift import IOError as HBaseIOError # pylint: disable=import-error
46+
try:
47+
# this is only importable after happybase module
48+
# pylint: disable=import-error
49+
from Hbase_thrift import IOError as HBaseIOError
50+
except ImportError:
51+
# probably Happybase <= 0.9
52+
# pylint: disable=import-error,no-name-in-module,ungrouped-imports
53+
from happybase.hbase.ttypes import IOError as HBaseIOError
4854
from thriftpy.thrift import TException as ThriftException
4955
except ImportError as _:
5056
print('Happybase / thrift module import error - did you forget to build this project?\n\n'
@@ -63,7 +69,7 @@
6369
sys.exit(4)
6470

6571
__author__ = 'Hari Sekhon'
66-
__version__ = '0.3'
72+
__version__ = '0.4'
6773

6874

6975
class HBaseCompactTables(CLI):

0 commit comments

Comments
 (0)