diff --git a/code/memanalyzer.py b/code/memanalyzer.py index bd38f656..181e7283 100644 --- a/code/memanalyzer.py +++ b/code/memanalyzer.py @@ -19,11 +19,15 @@ import argparse import os import re import shlex -import subprocess import sys from collections import OrderedDict - from sortedcontainers import SortedDict +import subprocess + +if (sys.version_info > (3, 0)): + from subprocess import getstatusoutput as getstatusoutput +else: + from commands import getstatusoutput as getstatusoutput # ------------------------------------------------------------------------------- @@ -112,7 +116,6 @@ def modules_get(): del modules_['NETBIOS'] return modules_ - try: # Parse command line options @@ -126,9 +129,10 @@ try: print() print(description) print() + # Check xtensa-lx106-elf-objdump is in the path - status, result = subprocess.getstatusoutput(objdump_binary) - if status != 512: + status, result = getstatusoutput(objdump_binary) + if status != 2 and status != 512: print("xtensa-lx106-elf-objdump not found, please check it is in your PATH") sys.exit(1) diff --git a/code/ota.py b/code/ota.py index 403235bc..ed862f0d 100644 --- a/code/ota.py +++ b/code/ota.py @@ -72,7 +72,7 @@ def list(): "SDK_SIZE", "FREE_SPACE" )) - print "-" * 146 + print("-" * 146) index = 0 for device in devices: @@ -195,7 +195,7 @@ if __name__ == '__main__': zeroconf.close() if len(devices) == 0: - print "Nothing found!\n" + print("Nothing found!\n") sys.exit(0) # Sort list diff --git a/code/requirements.txt b/code/requirements.txt index f8acf8d1..a358f38e 100644 --- a/code/requirements.txt +++ b/code/requirements.txt @@ -1,5 +1,4 @@ enum-compat==0.0.2 -enum34==1.1.6 netifaces==0.10.6 ordereddict==1.1 six==1.11.0