diff options
author | Jason Gross <jgross@mit.edu> | 2017-11-10 12:21:50 -0500 |
---|---|---|
committer | Jason Gross <jgross@mit.edu> | 2017-11-10 12:21:50 -0500 |
commit | e33fbe658530bfc3f455139be715def8b3467d3d (patch) | |
tree | b1e290d733010d7551c585f4f8c047643995a95f /src/Specific/Framework | |
parent | 228a5a977ab9cdb455fa5ee046858ab085b346f7 (diff) |
Update make_curve.py for python3
In python2, we require unicode. In python3, "unicode" as a type doesn't
exist. So we do a feature-check-kludge to set unicode to str if it
doesn't exist.
Diffstat (limited to 'src/Specific/Framework')
-rwxr-xr-x | src/Specific/Framework/make_curve.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Specific/Framework/make_curve.py b/src/Specific/Framework/make_curve.py index b652090b8..71f6d6ad7 100755 --- a/src/Specific/Framework/make_curve.py +++ b/src/Specific/Framework/make_curve.py @@ -3,6 +3,14 @@ from __future__ import with_statement import json, sys, os, math, re, shutil, io from fractions import Fraction +### Python 2/3 compatibility hacks +# unicode doesn't exist in python3 (str is unicode by default), so we +# set unicode to str there (but we need proper unicode in python2) +try: + unicode +except NameError: + unicode = str + DEFAULT_A24_FOR_BENCH = 121665 def compute_bitwidth(base): return 2**int(math.ceil(math.log(base, 2))) |