Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with if statements #29

Open
skwde opened this issue Jan 29, 2021 · 1 comment
Open

problems with if statements #29

skwde opened this issue Jan 29, 2021 · 1 comment

Comments

@skwde
Copy link

skwde commented Jan 29, 2021

Hi,

I use the current version pycodestyle-magic-0.5.

At the beginning of the notebook I do

%load_ext pycodestyle_magic
%pycodestyle_on
#%flake8_on # does not work

Then the following throws a ValueError

t = True
if t1 == True:
    print('1')

i.e.

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/usr/local/anaconda3/lib/python3.8/site-packages/pycodestyle_magic.py in auto_run_pycodestyle(self, result)
     44 
     45     def auto_run_pycodestyle(self, result):
---> 46         pycodestyle(1, result.info.raw_cell, auto=True)
     47         if result.error_before_exec:
     48             print('Error before execution: %s' % result.error_before_exec)

<decorator-gen-123> in pycodestyle(line, cell, auto)

/usr/local/anaconda3/lib/python3.8/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
    218     # but it's overkill for just that one bit of state.
    219     def magic_deco(arg):
--> 220         call = lambda f, *a, **k: f(*a, **k)
    221 
    222         # Find get_ipython() in the caller's namespace

/usr/local/anaconda3/lib/python3.8/site-packages/pycodestyle_magic.py in pycodestyle(line, cell, auto)
    173         #logger.info(line)
    174         # on windows drive path also contains :
--> 175         line, col, error = line.split(':')[-4:]
    176         # do not subtract 1 for line for %%pycodestyle, inc pre py3.6 string
    177         if auto:

ValueError: too many values to unpack (expected 3)

Best,
skwde

@jtweeder
Copy link

Appears to be related to #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants