tuir-1.29.0-config.py-readfp.patch 653 B

12345678910111213141516171819202122
  1. --- a/tuir/config.py 2024-06-25 11:09:03.587702247 +0200
  2. +++ b/tuit/config.py 2024-06-25 11:43:03.826798382 +0200
  3. @@ -2,6 +2,7 @@
  4. from __future__ import unicode_literals
  5. import os
  6. +import sys
  7. import codecs
  8. import shutil
  9. import argparse
  10. @@ -131,7 +132,10 @@
  11. config = configparser.RawConfigParser()
  12. if os.path.exists(filename):
  13. with codecs.open(filename, encoding='utf-8') as fp:
  14. - config.readfp(fp)
  15. + if sys.version_info.major >= 3:
  16. + config.read_file(fp)
  17. + else:
  18. + config.readfp(fp)
  19. return cls._parse_tuir_file(config)