Pregunta

I have encountered :

pywintypes.py:39: DeprecationWarning: imp.get_suffixes() is deprecated; 
use the constants defined on importlib.machinery instead

but i don't know how to repair it ? could any one explain for me in detail?

¿Fue útil?

Solución

As the message explains you should use the _SUFFIXES constants that are part of importlib.machinery. These were introduced in Python 3.3. The deprecation message means you should now use those constants instead of calling imp.get_suffixes().

If you can't upgrade to Python 3.3 yet then that's fine (things currently still work) but it's something to be aware of when upgrading in the future.

Otros consejos

Deprecated does not mean that it is broken and need repairing. It simply means that you should avoid using this function because it will soon be gotten rid of and possibly superseded by something else. In this case it is saying to use the constants in importlib.machinery. Your code should still work if you ignore the warning, it just won't be future-proofed, i.e an update may break your code.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top