Thu, 31 Aug 2023 14:07:24 +0200
Third Party packages
- Upgraded eradicate to version 2.3.0.
--- a/docs/ThirdParty.md Thu Aug 31 13:59:43 2023 +0200 +++ b/docs/ThirdParty.md Thu Aug 31 14:07:24 2023 +0200 @@ -5,7 +5,7 @@ | Name | Version | License | |:------------:|:---------:|:----------------------------| -| eradicate | 2.2.0 | MIT License (Expat License) | +| eradicate | 2.3.0 | MIT License (Expat License) | | mccabe | 0.7.0 | MIT License (Expat License) | | pipdeptree | 2.7.1 | MIT License (MIT) | | pip-licenses | 4.3.1 | MIT License (MIT) |
--- a/docs/changelog.md Thu Aug 31 13:59:43 2023 +0200 +++ b/docs/changelog.md Thu Aug 31 14:07:24 2023 +0200 @@ -1,5 +1,10 @@ # Change Log +### Version 23.10 +- bug fixes +- Third Party packages + - Upgraded eradicate to version 2.3.0. + ### Version 23.9 - bug fixes - MicroPython
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Miscellaneous/eradicate.py Thu Aug 31 13:59:43 2023 +0200 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Miscellaneous/eradicate.py Thu Aug 31 14:07:24 2023 +0200 @@ -27,10 +27,17 @@ import difflib import io import os +import sys import re import tokenize -__version__ = '2.2.0' +try: + detect_encoding = tokenize.detect_encoding +except AttributeError: + from lib2to3.pgen2 import tokenize as lib2to3_tokenize + detect_encoding = lib2to3_tokenize.detect_encoding + +__version__ = '2.3.0' class Eradicator(object): @@ -213,8 +220,7 @@ """Return file encoding.""" try: with open(filename, 'rb') as input_file: - from lib2to3.pgen2 import tokenize as lib2to3_tokenize - encoding = lib2to3_tokenize.detect_encoding(input_file.readline)[0] + encoding = detect_encoding(input_file.readline)[0] # Check for correctness of encoding. with self.open_with_encoding(filename, encoding) as input_file: @@ -236,7 +242,7 @@ flags=re.IGNORECASE) -def main(argv, standard_out, standard_error): +def main(argv=sys.argv, standard_out=sys.stdout, standard_error=sys.stderr): """Main entry point.""" import argparse parser = argparse.ArgumentParser(description=__doc__, prog='eradicate') @@ -292,5 +298,10 @@ except IOError as exception: print('{}'.format(exception), file=standard_error) change_or_error = True + if change_or_error and args.error: return 1 + + +if __name__ == '__main__': + main()