From 3e9469b3ee8b64b848acfe391f3b52b230ad0bdd Mon Sep 17 00:00:00 2001 From: Riccardo Date: Sun, 30 Jun 2019 14:19:31 -0700 Subject: [PATCH] Fixing tests after min->MIN change --- python/esptool.py | 2 +- tests/elm_car_simulator.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/esptool.py b/python/esptool.py index e68e6cd6e06779..970aa3d4d83fd5 100755 --- a/python/esptool.py +++ b/python/esptool.py @@ -1216,7 +1216,7 @@ def add_spi_flash_subparsers(parent, auto_detect=False): operation_func = globals()[args.operation] operation_args,_,_,_ = inspect.getargspec(operation_func) if operation_args[0] == 'esp': # operation function takes an ESPROM connection object - initial_baud = MIN(ESPROM.ESP_ROM_BAUD, args.baud) # don't sync faster than the default baud rate + initial_baud = min(ESPROM.ESP_ROM_BAUD, args.baud) # don't sync faster than the default baud rate esp = ESPROM(args.port, initial_baud) esp.connect() operation_func(esp, args) diff --git a/tests/elm_car_simulator.py b/tests/elm_car_simulator.py index bcee821cd04d44..f931e66ff40999 100755 --- a/tests/elm_car_simulator.py +++ b/tests/elm_car_simulator.py @@ -152,7 +152,7 @@ def __lin_process_msg(self, priority, toaddr, fromaddr, data): if len(outmsg) <= 5: self._lin_send(0x10, obd_header + outmsg) else: - first_msg_len = MIN(4, len(outmsg)%4) or 4 + first_msg_len = min(4, len(outmsg)%4) or 4 self._lin_send(0x10, obd_header + b'\x01' + b'\x00'*(4-first_msg_len) + outmsg[:first_msg_len]) @@ -229,7 +229,7 @@ def __can_process_msg(self, mode, pid, address, ts, data, src): outaddr = 0x7E8 if address == 0x7DF or address == 0x7E0 else 0x18DAF110 msgnum = 1 while(self.__can_multipart_data): - datalen = MIN(7, len(self.__can_multipart_data)) + datalen = min(7, len(self.__can_multipart_data)) msgpiece = struct.pack("B", 0x20 | msgnum) + self.__can_multipart_data[:datalen] self._can_send(outaddr, msgpiece) self.__can_multipart_data = self.__can_multipart_data[7:] @@ -246,7 +246,7 @@ def __can_process_msg(self, mode, pid, address, ts, data, src): self._can_send(outaddr, struct.pack("BBB", len(outmsg)+2, 0x40|data[1], pid) + outmsg) else: - first_msg_len = MIN(3, len(outmsg)%7) + first_msg_len = min(3, len(outmsg)%7) payload_len = len(outmsg)+3 msgpiece = struct.pack("BBBBB", 0x10 | ((payload_len>>8)&0xF), payload_len&0xFF,