Skip to content

Commit 9a44508

Browse files
committed
Fixed Issue 33. Thanks to Paul Hollensen!
1 parent 3e8647f commit 9a44508

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

nxt/usbsock.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# nxt.usbsock module -- USB socket communication with LEGO Minstorms NXT
22
# Copyright (C) 2006, 2007 Douglas P Lau
33
# Copyright (C) 2009 Marcus Wanner
4+
# Copyright (C) 2011 Paul Hollensen, Marcus Wanner
45
#
56
# This program is free software: you can redistribute it and/or modify
67
# it under the terms of the GNU General Public License as published by
@@ -12,7 +13,7 @@
1213
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1314
# GNU General Public License for more details.
1415

15-
import usb
16+
import usb, os
1617
from nxt.brick import Brick
1718

1819
ID_VENDOR_LEGO = 0x0694
@@ -43,7 +44,8 @@ def connect(self):
4344
self.handle = self.device.open()
4445
self.handle.setConfiguration(1)
4546
self.handle.claimInterface(0)
46-
self.handle.reset()
47+
if os.name != 'nt': # http://code.google.com/p/nxt-python/issues/detail?id=33
48+
self.handle.reset()
4749
if self.debug:
4850
print 'Connected.'
4951
return Brick(self)

0 commit comments

Comments
 (0)