File 8926-unicode-Eliminate-old-style-catches.patch of Package erlang

From 645aa0571cbee0226370c7034f2b109b6095ceb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Sat, 11 Jan 2025 09:44:55 +0100
Subject: [PATCH 6/7] unicode: Eliminate old-style catches

---
 lib/stdlib/src/unicode.erl | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/stdlib/src/unicode.erl b/lib/stdlib/src/unicode.erl
index b631b7058d..741534c7a4 100644
--- a/lib/stdlib/src/unicode.erl
+++ b/lib/stdlib/src/unicode.erl
@@ -1153,9 +1151,7 @@ do_o_binary(F,L) ->
 do_o_binary2(_F,[]) ->
     <<>>;
 do_o_binary2(F,[H|T]) ->
-    case (catch F(H)) of
-	{'EXIT',_} ->
-	    {error,<<>>,[H|T]};
+    try F(H) of
 	Bin when is_binary(Bin) ->
 	    case do_o_binary2(F,T) of
 		{error,Bin2,Rest} ->
@@ -1163,6 +1159,9 @@ do_o_binary2(F,[H|T]) ->
 		Bin3 ->
 		    [Bin|Bin3]
 	    end
+    catch
+        error:_ ->
+	    {error,<<>>,[H|T]}
     end.
 
 %% Specific functions only allowing codepoints in latin1 range
-- 
2.51.0

openSUSE Build Service is sponsored by