Chromium Code Reviews| Index: appengine_module/gae_event_mon/__init__.py |
| diff --git a/appengine_module/gae_event_mon/__init__.py b/appengine_module/gae_event_mon/__init__.py |
| index 6f3b959b97ac46d608d54f31c18cb4c875011ba5..ca72adf1734d99c192ee3b69cb88ecfb96805ec8 100644 |
| --- a/appengine_module/gae_event_mon/__init__.py |
| +++ b/appengine_module/gae_event_mon/__init__.py |
| @@ -2,6 +2,7 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import imp |
| import logging |
| import os |
| import sys |
| @@ -19,6 +20,21 @@ sys.modules['infra_libs'].InstrumentedHttp = ( |
| sys.modules['infra_libs'].event_mon = sys.modules[__package__] |
| sys.modules['infra_libs.event_mon'] = sys.modules[__package__] |
| +# Import time_functions explicitly, since gae_ts_mon messes with infra_libs. |
| +# TODO(sergeyberezin): clean up this mess. Do not meddle with magic. |
|
Sergey Berezin
2016/08/04 20:21:25
FYI: this is the ugliest thing I had to do for thi
|
| +try: |
| + tf_file, tf_path, tf_desc = imp.find_module( |
| + 'time_functions', |
| + [os.path.dirname(__file__)]) |
| + tf_module = imp.load_module( |
| + 'infra_libs.time_functions', tf_file, tf_path, tf_desc) |
| +finally: |
| + if tf_file: |
| + tf_file.close() |
| + |
| +sys.modules['infra_libs'].time_functions = tf_module |
| +sys.modules['infra_libs.time_functions'] = tf_module |
| + |
| from google.appengine.api import modules |
| from google.appengine.api.app_identity import app_identity |