shotgunsoftware / python-api

A Python-based library for accessing Flow Production Tracking API.
https://developer.shotgridsoftware.com/python-api
Other
306 stars 198 forks source link

mimetypes.py: fix incompatibility with python3 due to old 'print' keyword and exception 'comma' syntax #265

Closed uikokahonia closed 7 months ago

uikokahonia commented 2 years ago

Changing print statements from the old py2 'print' keyword syntax into the newer 'print' function syntax, also changing one try-except exception catching from the old 'comma' syntax to the newer 'as' keyword syntax. Now this module can be imported in both python3 and python2 safely, prior to that it was not compatible with python3.

Note: the 'as' assignment within an exception catching is not compatible with python <= 2.5 but it is better to have this module compatible with python3 than with python <= 2.5 (https://peps.python.org/pep-3110/)

carlos-villavicencio-adsk commented 7 months ago

We're dropping support for Python 2. This module will be removed in the future. We appreciate your contribution.