Skip to content

Commit

Permalink
[python] Fix undefined TimeoutError in tests
Browse files Browse the repository at this point in the history
The tests use TimeoutError, which is not defined in Python 2
(but is in Python 3). I added a minimal definition of
TimeoutError.

Change-Id: I1c6c634803cf5cc8f083f4480606aed10f86db91
Reviewed-on: http://gerrit.cloudera.org:8080/7078
Tested-by: Kudu Jenkins
Reviewed-by: Will Berkeley <[email protected]>
  • Loading branch information
Will Berkeley authored and wdberkeley committed Jun 12, 2017
1 parent 681f05b commit 636e2a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions python/kudu/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
import kudu
from kudu.client import Partitioning

# There's no built-in timeout error in Python 2.
# See https://stackoverflow.com/questions/2281850.
class TimeoutError(Exception):
pass

class KuduTestBase(object):

"""
Expand Down
2 changes: 1 addition & 1 deletion python/kudu/tests/test_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from kudu.compat import unittest
from kudu.tests.util import TestScanBase
from kudu.tests.common import KuduTestBase
from kudu.tests.common import KuduTestBase, TimeoutError
import kudu
import datetime
import time
Expand Down

0 comments on commit 636e2a9

Please sign in to comment.