From 330b2daaaa3c34193725a7ce3f1d768268c90627 Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Sat, 18 Nov 2023 23:48:49 -0500 Subject: [PATCH] refactored codes --- cli50/__main__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cli50/__main__.py b/cli50/__main__.py index b62fa4e..d1db84c 100644 --- a/cli50/__main__.py +++ b/cli50/__main__.py @@ -6,7 +6,6 @@ import argparse import gettext import inflect -import importlib import json import os import re @@ -17,6 +16,7 @@ import textwrap import tzlocal from packaging import version +from importlib.resources import files from . import __version__ @@ -36,8 +36,7 @@ TAG = "latest" # Internationalization -path = importlib.resources.files("cli50").joinpath("locale") -t = gettext.translation("cli50", str(path), fallback=True) +t = gettext.translation("cli50", str(files("cli50").joinpath("locale")), fallback=True) t.install()