Description: Fix pytables expressions with Python 3.9

ast.Index has been replaced by a bare value, so we need to do the
conversion from Constant to int

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/972015
Forwarded: https://github.com/pandas-dev/pandas/issues/37217

--- a/pandas/core/computation/pytables.py
+++ b/pandas/core/computation/pytables.py
@@ -425,6 +425,10 @@ class PyTablesExprVisitor(BaseExprVisito
             value = value.value
         except AttributeError:
             pass
+        try:
+            slobj = slobj.value
+        except AttributeError:
+            pass
 
         if isinstance(slobj, Term):
             # In py39 np.ndarray lookups with Term containing int raise
