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

TypeError: unorderable types because cur_token.node_split_penalty is None #8

Closed
The-Compiler opened this issue Mar 25, 2015 · 1 comment

Comments

@The-Compiler
Copy link

When running yapf over this code:

class CookieJar(RAMCookieJar):

    def purge_old_cookies(self):
        cookies = [c for c in self.allCookies()
                   if c.isSessionCookie() or c.expirationDate() >= now]

I get:

Traceback (most recent call last):  
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main  
    "__main__", mod_spec)  
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code  
    exec(code, run_globals)  
  File "/home/florian/proj/qutebrowser/.venv/lib/python3.4/site-packages/yapf/__main__.py", line 18, in <module>  
    sys.exit(yapf.main(sys.argv))  
  File "/home/florian/proj/qutebrowser/.venv/lib/python3.4/site-packages/yapf/__init__.py", line 102, in main  
    print_diff=args.diff)  
  File "/home/florian/proj/qutebrowser/.venv/lib/python3.4/site-packages/yapf/__init__.py", line 124, in FormatFiles  
    filename, style_config=style_config, lines=lines, print_diff=print_diff)  
  File "/home/florian/proj/qutebrowser/.venv/lib/python3.4/site-packages/yapf/yapflib/yapf_api.py", line 68, in FormatFile  
    print_diff=print_diff)  
  File "/home/florian/proj/qutebrowser/.venv/lib/python3.4/site-packages/yapf/yapflib/yapf_api.py", line 101, in FormatCode  
    uwl.CalculateFormattingInformation()  
  File "/home/florian/proj/qutebrowser/.venv/lib/python3.4/site-packages/yapf/yapflib/unwrapped_line.py", line 77, in CalculateFormattingInformation  
    token.split_penalty += _SplitPenalty(prev_token, token)  
  File "/home/florian/proj/qutebrowser/.venv/lib/python3.4/site-packages/yapf/yapflib/unwrapped_line.py", line 342, in _SplitPenalty  
    if cur_token.node_split_penalty > 0:  
TypeError: unorderable types: NoneType() > int()
@eliben
Copy link
Member

eliben commented Mar 25, 2015

I believe this should be fixed now. Reopen if not.

@eliben eliben closed this as completed Mar 25, 2015
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