remove branches of if/else for python2
Checklist
-
I have read the contribution guidelines. -
Unit tests have been added for any new or changed code, and the test suite passes. Note: Your request will likely not be merged without the appropriate tests. -
New features and API Changes are described in doc/releasenotes.rst
. -
"closes #XXXX" is in the body of the MR description to link the related issue, if applicable.
Edited by Ask Hjorth Larsen