From 968d2d595e6c2e888f0cce1299a81506cd25c737 Mon Sep 17 00:00:00 2001 From: Aolin Date: Sun, 4 Dec 2022 23:10:49 +0800 Subject: [PATCH] Fix compatibility with old Python versions --- tidbcloudy/api/_base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tidbcloudy/api/_base.py b/tidbcloudy/api/_base.py index b9a4cab..4ed5de1 100644 --- a/tidbcloudy/api/_base.py +++ b/tidbcloudy/api/_base.py @@ -22,7 +22,8 @@ class TiDBCloudyBase: def __init_subclass__(cls): cls._keys = {} for key in cls.__slots__: - key = key.removeprefix("_") + if key.startswith("_"): + key = key[1:] cls._keys[key] = getattr(cls, key) def __init__(self, **kwargs):