-import sys, stat, struct, subprocess, time
-import tos
+import sys, stat, struct, subprocess, time, os.path
+try:
+ import tos
+except ImportError:
+ import posix
+ sys.path = [os.path.join(posix.environ['TOSROOT'], 'support', 'sdk', 'python')] + sys.path
+ import tos