# HG changeset patch # User Sylvain Thénault # Date 1316678537 -7200 # Node ID ce8a4de2ecf1c145b8506ec0e83c9bfac625ab27 # Parent 2c73fc529a20d2bfa2d0631b9ff5dfcc1cbb2a61 [warnings] explicitly ask to show DeprecationWarning in debug mode (closes #1942760) as python 2.7 don't show DeprecationWarning by default diff -r 2c73fc529a20 -r ce8a4de2ecf1 cwconfig.py --- a/cwconfig.py Wed Sep 21 19:04:33 2011 +0200 +++ b/cwconfig.py Thu Sep 22 10:02:17 2011 +0200 @@ -144,7 +144,8 @@ from threading import Lock from os.path import (exists, join, expanduser, abspath, normpath, basename, isdir, dirname, splitext) -from warnings import warn +from warnings import warn, filterwarnings + from logilab.common.decorators import cached, classproperty from logilab.common.deprecation import deprecated from logilab.common.logging_ext import set_log_methods, init_log @@ -696,6 +697,9 @@ return vregpath def __init__(self, debugmode=False): + if debugmode: + # in python 2.7, DeprecationWarning are not shown anymore by default + filterwarnings('default', category=DeprecationWarning) register_stored_procedures() self._cubes = None super(CubicWebNoAppConfiguration, self).__init__()