Commit ca04c80
committed
fix: result.Ok to keep debugpy from converting Ok to Err
This is a strange bug in debugpy that randomly changes
an Ok variant to an Err variant. What happens is in the
background the python debugger evaluates all class properties.
But evaluating result.Err for an Ok(value) converts it to
an Err(e) and returns itself (since it resulted in an error).
This leads to random changing of Ok(value) variables by
the debugger, that would then work perfectly fine under
normal execution. This fix for changes both the Ok and
Err properties to return a new instance of an Err(e)
if they result in an error and DOES NOT alter self.1 parent c8813f0 commit ca04c80
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1087 | 1087 | | |
1088 | 1088 | | |
1089 | 1089 | | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
1094 | 1098 | | |
1095 | 1099 | | |
1096 | 1100 | | |
| |||
0 commit comments