Skip to content

Commit 8d9ed6e

Browse files
committed
Version 0.6.1: TracedException is no longer an exception itself.
1 parent 1462ab8 commit 8d9ed6e

File tree

8 files changed

+25
-33
lines changed

8 files changed

+25
-33
lines changed

conda/raffiot/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set name = "raffiot" %}
2-
{% set version = "0.6.0" %}
2+
{% set version = "0.6.1" %}
33

44
package:
55
name: "{{ name|lower }}"

docs/api/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3173,7 +3173,7 @@ <h3>Methods</h3>
31733173
</summary>
31743174
<pre><code class="python">@final
31753175
@dataclass
3176-
class TracedException(Exception):
3176+
class TracedException:
31773177
__slots__ = [&#34;exception&#34;, &#34;stack_trace&#34;]
31783178

31793179
exception: Exception
@@ -3226,11 +3226,6 @@ <h3>Methods</h3>
32263226
) -&gt; List[TracedException]:
32273227
return [cls.ensure_traced(exn) for exn in exceptions]</code></pre>
32283228
</details>
3229-
<h3>Ancestors</h3>
3230-
<ul class="hlist">
3231-
<li>builtins.Exception</li>
3232-
<li>builtins.BaseException</li>
3233-
</ul>
32343229
<h3>Static methods</h3>
32353230
<dl>
32363231
<dt id="raffiot.TracedException.ensure_list_traced"><code class="name flex">

docs/api/untyped/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3025,7 +3025,7 @@ <h3>Methods</h3>
30253025
<span>Expand source code</span>
30263026
</summary>
30273027
<pre><code class="python">@dataclass
3028-
class TracedException(Exception):
3028+
class TracedException:
30293029
__slots__ = [&#34;exception&#34;, &#34;stack_trace&#34;]
30303030

30313031
exception: None
@@ -3076,11 +3076,6 @@ <h3>Methods</h3>
30763076
def ensure_list_traced(cls, exceptions):
30773077
return [cls.ensure_traced(exn) for exn in exceptions]</code></pre>
30783078
</details>
3079-
<h3>Ancestors</h3>
3080-
<ul class="hlist">
3081-
<li>builtins.Exception</li>
3082-
<li>builtins.BaseException</li>
3083-
</ul>
30843079
<h3>Static methods</h3>
30853080
<dl>
30863081
<dt id="raffiot.untyped.TracedException.ensure_list_traced"><code class="name flex">

docs/api/untyped/utils.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ <h1 class="title">Module <code>raffiot.untyped.utils</code></h1>
4545

4646

4747
@dataclass
48-
class TracedException(Exception):
48+
class TracedException:
4949
__slots__ = [&#34;exception&#34;, &#34;stack_trace&#34;]
5050

5151
exception: None
@@ -478,7 +478,7 @@ <h3>Instance variables</h3>
478478
<span>Expand source code</span>
479479
</summary>
480480
<pre><code class="python">@dataclass
481-
class TracedException(Exception):
481+
class TracedException:
482482
__slots__ = [&#34;exception&#34;, &#34;stack_trace&#34;]
483483

484484
exception: None
@@ -529,11 +529,6 @@ <h3>Instance variables</h3>
529529
def ensure_list_traced(cls, exceptions):
530530
return [cls.ensure_traced(exn) for exn in exceptions]</code></pre>
531531
</details>
532-
<h3>Ancestors</h3>
533-
<ul class="hlist">
534-
<li>builtins.Exception</li>
535-
<li>builtins.BaseException</li>
536-
</ul>
537532
<h3>Static methods</h3>
538533
<dl>
539534
<dt id="raffiot.untyped.utils.TracedException.ensure_list_traced"><code class="name flex">

docs/api/utils.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h1 class="title">Module <code>raffiot.utils</code></h1>
5050

5151
@final
5252
@dataclass
53-
class TracedException(Exception):
53+
class TracedException:
5454
__slots__ = [&#34;exception&#34;, &#34;stack_trace&#34;]
5555

5656
exception: Exception
@@ -494,7 +494,7 @@ <h3>Instance variables</h3>
494494
</summary>
495495
<pre><code class="python">@final
496496
@dataclass
497-
class TracedException(Exception):
497+
class TracedException:
498498
__slots__ = [&#34;exception&#34;, &#34;stack_trace&#34;]
499499

500500
exception: Exception
@@ -547,11 +547,6 @@ <h3>Instance variables</h3>
547547
) -&gt; List[TracedException]:
548548
return [cls.ensure_traced(exn) for exn in exceptions]</code></pre>
549549
</details>
550-
<h3>Ancestors</h3>
551-
<ul class="hlist">
552-
<li>builtins.Exception</li>
553-
<li>builtins.BaseException</li>
554-
</ul>
555550
<h3>Static methods</h3>
556551
<dl>
557552
<dt id="raffiot.utils.TracedException.ensure_list_traced"><code class="name flex">

raffiot/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
@final
2424
@dataclass
25-
class TracedException(Exception):
25+
class TracedException:
2626
__slots__ = ["exception", "stack_trace"]
2727

2828
exception: Exception

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! env python3
22
from setuptools import setup
33

4-
version = "0.6.0"
4+
version = "0.6.1"
55

66
with open("README.md", "r", encoding="utf-8") as fh:
77
long_description = fh.read()

tests/test_io.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def f(j: int) -> IO[R, E, A]:
304304
return defer(print, j)
305305

306306
def h():
307-
raise TracedException(MatchError(j), "")
307+
raise MatchError(j)
308308

309309
return defer(h)
310310

@@ -319,9 +319,21 @@ def g(j: int) -> Result[E, A]:
319319
return result.ok(None)
320320
return result.panic(TracedException(MatchError(j), ""))
321321

322-
assert parallel([f(s) for s in l]).flat_map(wait).run(None) == result.ok(
323-
[g(s) for s in l]
324-
)
322+
res = parallel([f(s) for s in l]).flat_map(wait).run(None)
323+
324+
if res.is_ok():
325+
326+
def erase_stack_traces(r):
327+
if r.is_panic():
328+
return result.Panic(
329+
[TracedException(e.exception, "") for e in r.exceptions],
330+
r.errors,
331+
)
332+
return r
333+
334+
res = result.Ok([erase_stack_traces(r) for r in res.success])
335+
336+
assert res == result.ok([g(s) for s in l])
325337

326338
@given(st.lists(st.integers()))
327339
def test_parallel_wait_zip_ok(self, l: List[int]):

0 commit comments

Comments
 (0)