Add lint rule to keep collect_env.py python2 compliant (#60946)
Summary:
Fixes T94400857
- [x] Add lint rule
- [x] Verify lint rule works
- [x] Fix torch/utils/collect_env.py
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60946
Reviewed By: malfet, mruberry
Differential Revision: D29457294
Pulled By: rsemenov
fbshipit-source-id: 3c0670408d7aee1479e1de335291deb13a04ace9