diff mbox series

python/chcat: Don't fail on missing translation files

Message ID 20220912074043.GB5803@suse.com (mailing list archive)
State Rejected
Headers show
Series python/chcat: Don't fail on missing translation files | expand

Commit Message

Johannes Segitz Sept. 12, 2022, 7:40 a.m. UTC
Exception handling was not in line with other files, causing chcat to
fail if translation files were not available

Signed-off-by: Johannes Segitz <jsegitz@suse.de>
---
 python/chcat/chcat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.35.3

Comments

Daniel Burgener Sept. 12, 2022, 12:51 p.m. UTC | #1
On 9/12/2022 3:40 AM, Johannes Segitz wrote:
> Exception handling was not in line with other files, causing chcat to
> fail if translation files were not available
> 
> Signed-off-by: Johannes Segitz <jsegitz@suse.de>
> ---
>   python/chcat/chcat | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/python/chcat/chcat b/python/chcat/chcat
> index e779fcc6..1b93e99b 100755
> --- a/python/chcat/chcat
> +++ b/python/chcat/chcat
> @@ -40,7 +40,7 @@ try:
>                       localedir="/usr/share/locale",
>                       **kwargs)
>       _ = t.gettext
> -except ImportError:
> +except:
>       try:
>           import builtins
>           builtins.__dict__['_'] = str
> --
> 2.35.3

I believe this was already fixed by 
https://lore.kernel.org/selinux/87tu83r2zk.fsf@redhat.com/T/#m55d405c1504f7bc4ffff5f5ea9152b45fdf6848d 
(commit 344463076b2a91e1d2c7f5cc3835dc1a53a05e88)?

-Daniel
Johannes Segitz Sept. 12, 2022, 1:06 p.m. UTC | #2
On Mon, Sep 12, 2022 at 08:51:32AM -0400, Daniel Burgener wrote:
> I believe this was already fixed by https://lore.kernel.org/selinux/87tu83r2zk.fsf@redhat.com/T/#m55d405c1504f7bc4ffff5f5ea9152b45fdf6848d
> (commit 344463076b2a91e1d2c7f5cc3835dc1a53a05e88)?

yes, looks like it. I sent this as a PR a few months ago and only came
around to sent it correctly now. Please diregrad the patch then

Johannes
diff mbox series

Patch

diff --git a/python/chcat/chcat b/python/chcat/chcat
index e779fcc6..1b93e99b 100755
--- a/python/chcat/chcat
+++ b/python/chcat/chcat
@@ -40,7 +40,7 @@  try:
                     localedir="/usr/share/locale",
                     **kwargs)
     _ = t.gettext
-except ImportError:
+except:
     try:
         import builtins
         builtins.__dict__['_'] = str