summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-03-29 18:09:31 -0700
committerGitHub <noreply@github.com>2019-03-29 18:09:31 -0700
commit3e2529386d221841137bd558fab71c91b5e00f1b (patch)
treef5d7fb17cad8c52f262decb4be95302a9f642f58
parentd2ce12f1315bf38df34edfef86701d4bc4f0db35 (diff)
downloadbinaryen-3e2529386d221841137bd558fab71c91b5e00f1b.tar.gz
binaryen-3e2529386d221841137bd558fab71c91b5e00f1b.tar.bz2
binaryen-3e2529386d221841137bd558fab71c91b5e00f1b.zip
Warn about running gen-s-parser.py with Python 2 (#1971)
-rwxr-xr-xscripts/gen-s-parser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py
index 2f63efe70..a1b3a2701 100755
--- a/scripts/gen-s-parser.py
+++ b/scripts/gen-s-parser.py
@@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import sys
+
instructions = [
("unreachable", "makeUnreachable()"),
("nop", "makeNop()"),
@@ -541,6 +543,10 @@ def generate_with_guard(generator, guard):
def main():
+ if sys.version_info.major != 3:
+ import datetime
+ print("It's " + str(datetime.datetime.now().year) + "! Use Python 3!")
+ sys.exit(1)
print_header()
generate_with_guard(instruction_parser, "INSTRUCTION_PARSER")