Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugins/wedo_plugin/usb/_interop.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wedo_plugin/usb/_interop.py')
-rw-r--r--plugins/wedo_plugin/usb/_interop.py10
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