Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93f2546

Browse files
Turn Warnings into errors (ProjectQ-Framework#159)
1 parent b13748d commit 93f2546

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ install:
4848
- pip$PY install -e .
4949

5050
# command to run tests
51-
script: export OMP_NUM_THREADS=1 && pytest projectq --cov projectq
51+
script: export OMP_NUM_THREADS=1 && pytest -W error projectq --cov projectq
5252

5353
after_success:
5454
- coveralls

examples/shor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
import math
44
import random
55
import sys
6-
from fractions import Fraction, gcd
6+
from fractions import Fraction
7+
try:
8+
from math import gcd
9+
except ImportError:
10+
from fractions import gcd
711

812
from builtins import input
913

projectq/libs/math/_constantmath.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
# limitations under the License.
1212

1313
import math
14-
from fractions import gcd
14+
try:
15+
from math import gcd
16+
except ImportError:
17+
from fractions import gcd
1518

1619
from projectq.ops import R, X, Swap, Measure, CNOT, QFT
1720
from projectq.meta import Control, Compute, Uncompute, CustomUncompute, Dagger

0 commit comments

Comments
 (0)