Skip to content

Commit fda7f33

Browse files
committed
remove deprecation warnings
1 parent 6c5477d commit fda7f33

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

tabcmd/execution/localize.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,7 @@ def _load_language(current_locale, domain, logger):
8383

8484

8585
def _get_default_locale():
86-
# c:\dev\tabcmd\tabcmd\execution\localize.py:85: DeprecationWarning 'locale.getdefaultlocale' is deprecated
87-
# see test_localize for details
88-
import logging
89-
90-
logging.captureWarnings(True)
91-
current_locale, encoding = locale.getdefaultlocale()
92-
logging.captureWarnings(False)
86+
current_locale = locale.setlocale(locale.LC_CTYPE, None)
9387
current_locale = _validate_lang(current_locale)
9488
return current_locale
9589

tabcmd/version.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# when we drop python 3.8, this could be replaced with this lighter weight option
2-
# from importlib.metadata import version, PackageNotFoundError
3-
from pkg_resources import get_distribution, DistributionNotFound
1+
from importlib.metadata import version, PackageNotFoundError
42

53
try:
6-
version = get_distribution("tabcmd").version
7-
except DistributionNotFound:
4+
version = version("tabcmd")
5+
except PackageNotFoundError:
86
version = "2.0.0"
97
pass

0 commit comments

Comments
 (0)