diff --git a/tests/nightly/model_backwards_compatibility_check/common.py b/tests/nightly/model_backwards_compatibility_check/common.py index d8ffca25a3f3..cbdc61948b88 100644 --- a/tests/nightly/model_backwards_compatibility_check/common.py +++ b/tests/nightly/model_backwards_compatibility_check/common.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file @@ -29,12 +29,9 @@ import re from mxnet.test_utils import assert_almost_equal -try: - cmp # Python 2 -except NameError: - # See: https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons - def cmp(x, y): # Python 3 - return (x > y) - (x < y) + +def cmp(x, y): # Python 3 + return (x > y) - (x < y) # Set fixed random seeds. mx.random.seed(7) diff --git a/tests/nightly/model_backwards_compatibility_check/model_backward_compat_checker.sh b/tests/nightly/model_backwards_compatibility_check/model_backward_compat_checker.sh index ba53146c3225..9980dff9da94 100755 --- a/tests/nightly/model_backwards_compatibility_check/model_backward_compat_checker.sh +++ b/tests/nightly/model_backwards_compatibility_check/model_backward_compat_checker.sh @@ -28,4 +28,4 @@ echo `pwd` echo '==========================' export MXNET_ENFORCE_DETERMINISM=1 -python model_backwards_compat_inference.py +python3 model_backwards_compat_inference.py diff --git a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py index 5d63e7e9bca3..ee966dd291f1 100644 --- a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py +++ b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py index 289d47c705db..f454eb7d3393 100644 --- a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py +++ b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file