[Python-Dev] Making sys.py3k_warning writable Right now, test_py3kwarn only runs if the test suite is run using the
-3 command line flag to Python. So for most regrtest runs (e.g. the
buildbots) this test will never be run.

 It would be nice to be able to turn the flag on from Python (e.g.
within test_py3kwarn). Is that possible?  Here's what I tried and it
didn't seem to work::

$ python_d.exe
Python 2.6a1+ (trunk:61715M, Mar 21 2008, 14:33:00) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys; sys.py3k_warning = True; callable(int)
True

And here's what happens when you specify -3 at the command line:

$ python_d.exe -3
Python 2.6a1+ (trunk:61715M, Mar 21 2008, 14:33:00) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> callable(int)
__main__:1: DeprecationWarning: callable() not supported in 3.x. Use
hasattr(o, '__call__').
True

Steve
-- 
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
 --- Bucky Katt, Get Fuzzy
_______________________________________________
Python-Dev mailing list
zvllln-eum@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40tangomu.com


