diff --git a/tables/atom.py b/tables/atom.py
index d5386980..2d8c7673 100644
--- a/tables/atom.py
+++ b/tables/atom.py
@@ -120,7 +120,7 @@ def _abstract_atom_init(deftype, defvalue):
 def _normalize_shape(shape):
     """Check that the `shape` is safe to be used and return it as a tuple."""
 
-    if isinstance(shape, (int, numpy.integer, int)):
+    if isinstance(shape, (numpy.integer, six.integer_types)):
         if shape < 1:
             raise ValueError("shape value must be greater than 0: %d"
                              % shape)
diff --git a/tables/idxutils.py b/tables/idxutils.py
index 99d85d15..470ea4c5 100644
--- a/tables/idxutils.py
+++ b/tables/idxutils.py
@@ -13,6 +13,7 @@
 """Utilities to be used mainly by the Index class."""
 from __future__ import absolute_import
 
+import six
 import sys
 import math
 import numpy
@@ -471,7 +472,7 @@ def nextafter(x, direction, dtype, itemsize):
     direction."""
 
     assert direction in [-1, 0, +1]
-    assert dtype.kind == "S" or type(x) in (bool, int, float)
+    assert dtype.kind == "S" or type(x) in (bool, float) + six.integer_types
 
     if direction == 0:
         return x
