dabeaz / ply

Python Lex-Yacc
http://www.dabeaz.com/ply/index.html
2.79k stars 465 forks source link

Replace removed assert_ with assertTrue #262

Closed hugovk closed 2 years ago

hugovk commented 2 years ago

assert_ has been deprecated since Python 3.5 and is removed in Python 3.11. Use assertTrue instead.

https://docs.python.org/3.11/whatsnew/3.11.html#removed https://bugs.python.org/issue45162

Before

$ python3.11 testlex.py
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
======================================================================
ERROR: test_lex_closure (__main__.LexBuildOptionTests)
----------------------------------------------------------------------
AttributeError: 'LexBuildOptionTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_many_tokens (__main__.LexBuildOptionTests)
----------------------------------------------------------------------
AttributeError: 'LexBuildOptionTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_module (__main__.LexBuildOptionTests)
----------------------------------------------------------------------
AttributeError: 'LexBuildOptionTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_object (__main__.LexBuildOptionTests)
----------------------------------------------------------------------
AttributeError: 'LexBuildOptionTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_doc1 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_dup1 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_dup2 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_dup3 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_empty (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_error1 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_error2 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_error3 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_error4 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_ignore (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_ignore2 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_literal1 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_literal2 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_re1 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_re2 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_re3 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_rule1 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_rule2 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_rule3 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_state1 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_state2 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_state3 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_state4 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_state5 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_state_noerror (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_state_norule (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_token1 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_token2 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_token3 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_token4 (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_token_dup (__main__.LexErrorWarningTests)
----------------------------------------------------------------------
AttributeError: 'LexErrorWarningTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_hedit (__main__.LexRunTests)
----------------------------------------------------------------------
AttributeError: 'LexRunTests' object has no attribute 'assert_'

======================================================================
ERROR: test_lex_state_try (__main__.LexRunTests)
----------------------------------------------------------------------
AttributeError: 'LexRunTests' object has no attribute 'assert_'

----------------------------------------------------------------------
Ran 37 tests in 0.213s

FAILED (errors=37)

After

$ python3.11 testlex.py
.....................................
----------------------------------------------------------------------
Ran 37 tests in 0.152s

OK
kloczek commented 2 years ago

Is it possible to make new release?

dabeaz commented 2 years ago

If by "release", you mean something that's distributed to PyPi and installable via pip or some similar tool, then that is never going to happen. I am no longer distributing PLY as an installable package. This is described in the setup.md file.