2

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?

4

2 回答 2

2

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.

于 2013-12-30T12:40:53.887 回答
0

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.

于 2013-12-30T12:40:43.917 回答