diff options
author | Alan Jhonn Aguiar Schwyn <alanjas@hotmail.com> | 2013-12-03 17:00:06 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2013-12-03 17:00:06 (GMT) |
commit | c3fe01df954d03839322901fccc43804d31f9f54 (patch) | |
tree | a265fe4066fa2e1283ca3ba764843fc037542ff3 /plugins/wedo_plugin/usb/_interop.py | |
parent | ad4497c688d4e15275736e235be8194dd68d81e0 (diff) |
new wedo plugin from TurtleBot
Diffstat (limited to 'plugins/wedo_plugin/usb/_interop.py')
-rw-r--r-- | plugins/wedo_plugin/usb/_interop.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/wedo_plugin/usb/_interop.py b/plugins/wedo_plugin/usb/_interop.py index 6069d5e..93b8f04 100644 --- a/plugins/wedo_plugin/usb/_interop.py +++ b/plugins/wedo_plugin/usb/_interop.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009-2011 Wander Lairson Costa +# Copyright (C) 2009-2013 Wander Lairson Costa # # The following terms apply to all files associated # with the software unless explicitly disclaimed in individual files. @@ -129,7 +129,9 @@ def as_array(data=None): try: return array.array('B', data) except TypeError: - # When you pass a unicode string, you got a TypeError - # if first parameter is not 'u' - return array.array('u', data) + # When you pass a unicode string or a character sequence, + # you get a TypeError if first parameter does not match + a = array.array('B') + a.fromstring(data) + return a |