Skip to content

Commit

Permalink
Fixed exception when entering negative phase in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdwetering committed Sep 30, 2020
1 parent 886aff7 commit 3a45ea9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pyzx/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def s_to_phase(s: str, t:VertexType.Type=VertexType.Z) -> Fraction:
if s.find('/') != -1:
a,b = s.split("/", 2)
if not a: return Fraction(1,int(b))
if a == '-': a = '-1'
return Fraction(int(a),int(b))
if not s: return Fraction(1)
return Fraction(int(s))
Expand Down

0 comments on commit 3a45ea9

Please sign in to comment.