From 8c2223de2028f5f15f53f3c4cf2999d10b25a8e4 Mon Sep 17 00:00:00 2001 From: Brandon Kinman Date: Sun, 8 Apr 2018 12:13:32 -0700 Subject: [PATCH 1/3] System version checking now works as expected --- tools/odrive/protocol.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/odrive/protocol.py b/tools/odrive/protocol.py index 18f44a41..c7305b19 100644 --- a/tools/odrive/protocol.py +++ b/tools/odrive/protocol.py @@ -6,14 +6,14 @@ import sys import abc -# if sys.version_info >= (3, 4): -ABC = abc.ABC -# else: -# ABC = abc.ABCMeta('ABC', (), {}) +if (sys.version_info[0], sys.version_info[1]) >= (3, 4): + ABC = abc.ABC +else: + ABC = abc.ABCMeta('ABC', (), {}) -# if sys.version_info <= (3, 3): -# from monotonic import monotonic -# time.monotonic = monotonic +if (sys.version_info[0], sys.version_info[1]) <= (3, 3): + from monotonic import monotonic + time.monotonic = monotonic SYNC_BYTE = 0xAA CRC8_INIT = 0x42 From 39ef119515e6315d0f8c771e6c522e71f98a3d71 Mon Sep 17 00:00:00 2001 From: Brandon Kinman Date: Sun, 8 Apr 2018 15:29:49 -0700 Subject: [PATCH 2/3] Making explore_odrive compatible with python27 --- tools/explore_odrive.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/explore_odrive.py b/tools/explore_odrive.py index 9efaebb7..ebe23bf8 100755 --- a/tools/explore_odrive.py +++ b/tools/explore_odrive.py @@ -1,3 +1,5 @@ +from __future__ import print_function + #!/usr/bin/env python3 """ Load an odrive object to play with in the IPython interactive shell. From 9d2b56998ff59f616ca64d3b8466f1e8632976f6 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Sat, 21 Apr 2018 00:13:28 -0700 Subject: [PATCH 3/3] Update protocol.py --- tools/odrive/protocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/odrive/protocol.py b/tools/odrive/protocol.py index c7305b19..aced6cc9 100644 --- a/tools/odrive/protocol.py +++ b/tools/odrive/protocol.py @@ -6,12 +6,12 @@ import sys import abc -if (sys.version_info[0], sys.version_info[1]) >= (3, 4): +if sys.version_info >= (3, 4): ABC = abc.ABC else: ABC = abc.ABCMeta('ABC', (), {}) -if (sys.version_info[0], sys.version_info[1]) <= (3, 3): +if sys.version_info < (3, 3): from monotonic import monotonic time.monotonic = monotonic