13-support-python-3.12.patch 935 B

12345678910111213141516171819202122232425
  1. --- contrib/python/boto/py3/boto/plugin.py (index)
  2. +++ contrib/python/boto/py3/boto/plugin.py (working tree)
  3. @@ -40 +40 @@ import glob
  4. -import imp
  5. +import importlib
  6. @@ -73,6 +73 @@ def _import_module(filename):
  7. - (file, filename, data) = imp.find_module(name, [path])
  8. - try:
  9. - return imp.load_module(name, file, filename, data)
  10. - finally:
  11. - if file:
  12. - file.close()
  13. + return importlib.import_module(name, [path])
  14. --- contrib/python/boto/py3/boto/pyami/launch_ami.py (index)
  15. +++ contrib/python/boto/py3/boto/pyami/launch_ami.py (working tree)
  16. @@ -25 +25 @@ import sys
  17. -import imp
  18. +import importlib.util
  19. @@ -135 +135 @@ def main():
  20. - l = imp.find_module(params['script_name'])
  21. + spec = importlib.util.find_spec(params['script_name'])
  22. @@ -139 +139,2 @@ def main():
  23. - key.set_contents_from_file(l[0])
  24. + with open(spec.origin) as f:
  25. + key.set_contents_from_file(f)