summaryrefslogtreecommitdiff
path: root/dev-python/loguru/files/loguru-0.7.3-py314.patch
blob: c47d8160828814e9f4f9b4e0049a1cc3b01c29bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 84023e2bd8339de95250470f422f096edcb8f7b7 Mon Sep 17 00:00:00 2001
From: Delgan <delgan.py@gmail.com>
Date: Sat, 5 Jul 2025 22:43:12 +0200
Subject: [PATCH] Fix failing "exception_modern" unit test with Python 3.14
 (#1331)

The test relies on the "repr()" output of a few classes which are
not meant to be considered as a stabilized API. In this
specific case, "Union" representation was changed upstream from
"typing.Union" to "<class 'typing.Union'>" (kind of leak
implementation details).

I simply  replaced the dummy "Union" with "Tuple" in the unit test,
since its representation appears stable acrcoss versions.
---
 tests/exceptions/output/modern/type_hints.txt | 4 ++--
 tests/exceptions/source/modern/type_hints.py  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/exceptions/output/modern/type_hints.txt b/tests/exceptions/output/modern/type_hints.txt
index 64484d3f..917180a3 100644
--- a/tests/exceptions/output/modern/type_hints.txt
+++ b/tests/exceptions/output/modern/type_hints.txt
@@ -10,11 +10,11 @@
                 └ <function foo at 0xDEADBEEF>
 
   File "tests/exceptions/source/modern/type_hints.py", line 15, in foo
-    def foo(a: int, b: Union[Name, float], c: "Name") -> T: 1 / 0
+    def foo(a: int, b: Tuple[Name, float], c: "Name") -> T: 1 / 0
         │   │       │  │     │             │             └ ~T
         │   │       │  │     │             └ 3
         │   │       │  │     └ <class 'str'>
-        │   │       │  └ typing.Union
+        │   │       │  └ typing.Tuple
         │   │       └ 2
         │   └ 1
         └ <function foo at 0xDEADBEEF>
diff --git a/tests/exceptions/source/modern/type_hints.py b/tests/exceptions/source/modern/type_hints.py
index 84b36e51..cda95a68 100644
--- a/tests/exceptions/source/modern/type_hints.py
+++ b/tests/exceptions/source/modern/type_hints.py
@@ -1,6 +1,6 @@
 # fmt: off
 import sys
-from typing import TypeVar, Union
+from typing import TypeVar, Tuple
 
 from loguru import logger
 
@@ -12,7 +12,7 @@
 Name = str
 
 
-def foo(a: int, b: Union[Name, float], c: "Name") -> T: 1 / 0
+def foo(a: int, b: Tuple[Name, float], c: "Name") -> T: 1 / 0
 
 
 def main():