Warnings on first usage #20

Closed
nvbn opened this Issue Jan 9, 2017 · 3 comments

Projects

None yet

3 participants

@nvbn
nvbn commented Jan 9, 2017

When bashlex used first time it prints:

WARNING: Token 'COND_ERROR' defined, but not used
WARNING: There is 1 unused token
@idank
Owner
idank commented Jan 9, 2017

Please provide more information. What code did you try?

@nvbn
nvbn commented Jan 9, 2017

I created new virtualenv with python 3.5, installed bashlex and run import bashlex; bashlex.parse("ls"):

➜  virtualenv -p /usr/bin/python3.5 test
Running virtualenv with interpreter /usr/bin/python3.5
Using base prefix '/usr'
New python executable in /tmp/test/bin/python3.5
Also creating executable in /tmp/test/bin/python
Installing setuptools, pip, wheel...done.
➜  source test/bin/activate
(test) ➜  pip install bashlex
Collecting bashlex
Collecting enum34 (from bashlex)
  Using cached enum34-1.1.6-py3-none-any.whl
Installing collected packages: enum34, bashlex
Successfully installed bashlex-0.12 enum34-1.1.6
(test) ➜  python -c 'import bashlex; bashlex.parse("ls")'
WARNING: Token 'COND_ERROR' defined, but not used
WARNING: There is 1 unused token
@josephfrazier
Contributor

I vaguely recall encountering this while working on nvbn/thefuck#580, but I guess I never got around to fixing it.

You can also reproduce the bug in a checkout of the repo by running:

rm bashlex/parsetab.py*; make tests

It looks like removing COND_ERROR from bashlex/tokenizer.py (the only place it is used) is sufficient to fix this, so I'll submit a PR.

@josephfrazier josephfrazier added a commit to josephfrazier/bashlex that referenced this issue Jan 11, 2017
@josephfrazier josephfrazier tokenizer: remove unused COND_ERROR
This fixes idank#20, as can be shown
by comparing the output of the following command before/after this
change:

    rm bashlex/parsetab.py*; make tests
c1e6555
@josephfrazier josephfrazier added a commit to josephfrazier/bashlex that referenced this issue Jan 11, 2017
@josephfrazier josephfrazier tokenizer: remove unused COND_ERROR (fixes #20)
This fixes idank#20, as can be shown
by comparing the output of the following command before/after this
change:

    rm bashlex/parsetab.py*; make tests
3ac9a8c
@idank idank closed this in #21 Jan 11, 2017
@idank idank added a commit that referenced this issue Jan 11, 2017
@josephfrazier @idank josephfrazier + tokenizer: remove unused COND_ERROR (fixes #20)
This fixes #20, as can be shown
by comparing the output of the following command before/after this
change:

    rm bashlex/parsetab.py*; make tests
18dc370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment