7 Commits

Author SHA1 Message Date
Zuul
75dc32815c Merge "[part1]:Remove six" 2020-10-14 13:32:58 +00:00
gugug
98cf92bdd8 [part1]:Remove six
We don't need this in a Python 3-only world.

This ps from six from tests

Change-Id: Ic51a74f314078f277b65c0a104a50e0d93b6e727
2020-06-16 22:47:10 +08:00
Hervé Beraud
5492731a83 Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I0c61adcc18a6c46e94df681f5adbd2cf1fad8963
2020-06-05 13:40:51 +02:00
Luong Anh Tuan
e5cb2569a6 Using sys.exit(main()) instead of main()
TrivialFix: Similar [1] in Kolla project
As we known, Exceptions are raised by the sys.exit() function. When they
are not handled, no stack traceback is printed in the Python interpreter.
Therefore, when using sys.exit(main()) instead of main()
may be more readable and reasonable.

[1] https://review.openstack.org/#/c/349353/

Change-Id: Ied52a7631da82a72f0dcf2fc9ed81840d24041d9
2016-09-26 03:23:44 +00:00
Graham Hayes
00892b3d45 Only print flake8 table if there is results
Change-Id: I1496280ff5003d507751f04a06b08942c89539da
2015-07-20 16:26:03 +01:00
sonu.kumar
884d3613af Replaced print with print() to provide py 2/3 compatibility
Replaced print statement of python 2 to print() of python 3
to provide py 2/3 compatibility.

Change-Id: I4d0501d37051607c2c7b44fe71374421765a922b
2015-07-20 18:10:10 +05:30
Graham Hayes
e33a3cf35a Test - add nicer formating to flake8 output
Change-Id: Ie1ee4ae5416277f5012646c8b47477e61ec55be0
2015-07-08 18:29:30 +01:00