Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Silence deprecation warnings from the app engine sdk

  • Loading branch information...
commit 673a0d106b9881abd5d8d77a8b687ad707bababa 1 parent d43016d
Ben Darnell authored
Showing with 13 additions and 8 deletions.
  1. +13 −8 tornado_tracing/recording.py
View
21 tornado_tracing/recording.py
@@ -12,13 +12,16 @@
import tornado.httpclient
import tornado.web
import tornado.wsgi
-
-from google.appengine.api import memcache as appengine_memcache
-from google.appengine.api import lib_config
-from google.appengine.ext import webapp
-from google.appengine.ext.appstats import recording
-from google.appengine.ext.appstats.recording import (
- start_recording, end_recording, pre_call_hook, post_call_hook)
+import warnings
+
+with warnings.catch_warnings():
+ warnings.simplefilter('ignore', DeprecationWarning)
+ from google.appengine.api import memcache as appengine_memcache
+ from google.appengine.api import lib_config
+ from google.appengine.ext import webapp
+ from google.appengine.ext.appstats import recording
+ from google.appengine.ext.appstats.recording import (
+ start_recording, end_recording, pre_call_hook, post_call_hook)
from tornado.httpclient import AsyncHTTPClient
from tornado.options import define, options
from tornado.stack_context import StackContext
@@ -106,7 +109,9 @@ def get_urlspec(prefix):
'''
# This import can't happen at the top level because things get horribly
# confused if it happens before django settings are initialized.
- from google.appengine.ext.appstats import ui
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', DeprecationWarning)
+ from google.appengine.ext.appstats import ui
wsgi_app = tornado.wsgi.WSGIContainer(webapp.WSGIApplication(ui.URLMAP))
return tornado.web.url(prefix,
tornado.web.FallbackHandler,
Please sign in to comment.
Something went wrong with that request. Please try again.