Open vlachoudis opened 6 years ago
Another odd symptom, it doesn't do this always. I have four defined in a row, with the following result (also, just minifying; not obfuscating):
Before
if sysname == 'linux' or sysname == 'win32':
# Mocks for non-pyboard use
import time
def ticks_us(): return (time.time()%1.e4)*1.e6
def ticks_diff(x, y): return x - y
def sleep_us(x): return time.sleep(x/1.e6)
def sleep_ms(x): return time.sleep(x/1.e3)
#Bus = lambda x: x
from unittest.mock import Mock, MagicMock
After:
if sysname=='linux' or sysname=='win32':
import time
def ticks_us():return(time.time()%1.e4)*1.e6
pass
def ticks_diff(x,y):return x-y
def sleep_us(x):return time.sleep(x/1.e6)
pass
def sleep_ms(x):return time.sleep(x/1.e3)
from unittest.mock import Mock,MagicMock
Oh well, making them not one-liners is a good enough workaround.
When obfuscating one lien function like
def square(x): return x**2
it append a pass below, which breaks the code like