Remove py2 specific code from test_utils.py (#42105)
Summary:
As https://github.com/pytorch/pytorch/issues/23795 mentioned drop Python 2 support. albanD
Fixes https://github.com/pytorch/pytorch/issues/31796
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42105
Reviewed By: ngimel
Differential Revision: D22765768
Pulled By: mrshenli
fbshipit-source-id: bae114a21cd5598004c7f92d313938ad826b4a24