Skip to content
This repository was archived by the owner on Sep 30, 2019. It is now read-only.

Commit 687adfb

Browse files
author
mpratt14
authored
FT232H.py: make print statements compatible with python 3
Similar to #102 In the future consider more print statements for where and when errors would appear in code
1 parent 498d8a1 commit 687adfb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Adafruit_GPIO/FT232H.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ def write(self, data):
472472
"""
473473
#check for hardware limit of FT232H and similar MPSSE chips
474474
if (len(data) > 65536):
475-
print 'the FTDI chip is limited to 65536 bytes (64 KB) of input/output per command!'
476-
print 'use for loops for larger reads'
475+
print('the FTDI chip is limited to 65536 bytes (64 KB) of input/output per command!')
476+
print('use for loops for larger reads')
477477
exit(1)
478478
# Build command to write SPI data.
479479
command = 0x10 | (self.lsbfirst << 3) | self.write_clock_ve
@@ -504,8 +504,8 @@ def read(self, length):
504504
"""
505505
#check for hardware limit of FT232H and similar MPSSE chips
506506
if (1 > length > 65536):
507-
print 'the FTDI chip is limited to 65536 bytes (64 KB) of input/output per command!'
508-
print 'use for loops for larger reads'
507+
print('the FTDI chip is limited to 65536 bytes (64 KB) of input/output per command!')
508+
print('use for loops for larger reads')
509509
exit(1)
510510
# Build command to read SPI data.
511511
command = 0x20 | (self.lsbfirst << 3) | (self.read_clock_ve << 2)
@@ -545,8 +545,8 @@ def bulkread(self, data = [], lengthR = 'None', readmode = 1):
545545
"""
546546
#check for hardware limit of FT232H and similar MPSSE chips
547547
if (1 > lengthR > 65536)|(len(data) > 65536):
548-
print 'the FTDI chip is limited to 65536 bytes (64 KB) of input/output per command!'
549-
print 'use for loops for larger reads'
548+
print('the FTDI chip is limited to 65536 bytes (64 KB) of input/output per command!')
549+
print('use for loops for larger reads')
550550
exit(1)
551551
#default mode is to act like `transfer` but half-duplex
552552
if (lengthR == 'None')&(readmode == 1):
@@ -592,8 +592,8 @@ def transfer(self, data):
592592
"""
593593
#check for hardware limit of FT232H and similar MPSSE chips
594594
if (len(data) > 65536):
595-
print 'the FTDI chip is limited to 65536 bytes (64 KB) of input/output per command!'
596-
print 'use for loops for larger reads'
595+
print('the FTDI chip is limited to 65536 bytes (64 KB) of input/output per command!')
596+
print('use for loops for larger reads')
597597
exit(1)
598598
# Build command to read and write SPI data.
599599
command = 0x30 | (self.lsbfirst << 3) | (self.read_clock_ve << 2) | self.write_clock_ve

0 commit comments

Comments
 (0)