> Programming Languages > Python
Various Topics Home | Disclaimer | Report Adult Posts

Various Topics on Python



Python - "Re: Python 2.3c1: Raising a string doesn't trigger PendingDeprecationWarning." in Programming Languages


Old 07-23-2003   #1
..dr.. ..nnet..
 
Default Re: Python 2.3c1: Raising a string doesn't trigger PendingDeprecationWarning.

On Wed, Jul 23, 2003 at 01:27:54AM -0700, Kerim wrote:
> "What's New in Python 2.3"
> (http://www.python.org/doc/2.3c1/whatsnew/node17.html) says that
> "Raising a string will now trigger PendingDeprecationWarning.". But
> with Python 2.3c1 it seems that it isn't the case:
>
> Python 2.3c1 (#44, Jul 18 2003, 14:32:36) [MSC v.1200 32 bit (Intel)]
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> raise 'error'

> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> error
> >>>


By default, the warnings module is configured to ignore
PendingDeprecationWarnings (as opposed to DeprecationWarnings). If you
instruct it otherwise, e.g. with -Wall, it does what you expect:

bash-2.05b$ python2.3 -Wall
Python 2.3b2+ (#2, Jul 5 2003, 11:28:28)
[GCC 3.3.1 20030626 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> raise "foo"

__main__:1: PendingDeprecationWarning: raising a string exception is deprecated
Traceback (most recent call last):
File "<stdin>", line 1, in ?
foo
>>>


-Andrew.


 

Thread Tools
Display Modes





Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0