From commits-return-6606-archive-asf-public=cust-asf.ponee.io@openwhisk.apache.org Wed Jan 30 19:16:58 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C5524180677 for ; Wed, 30 Jan 2019 20:16:57 +0100 (CET) Received: (qmail 93247 invoked by uid 500); 30 Jan 2019 19:16:56 -0000 Mailing-List: contact commits-help@openwhisk.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwhisk.apache.org Delivered-To: mailing list commits@openwhisk.apache.org Received: (qmail 93238 invoked by uid 99); 30 Jan 2019 19:16:56 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jan 2019 19:16:56 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 61AEC85732; Wed, 30 Jan 2019 19:16:56 +0000 (UTC) Date: Wed, 30 Jan 2019 19:16:56 +0000 To: "commits@openwhisk.apache.org" Subject: [incubator-openwhisk-runtime-python] branch master updated: disabled warnings at import for compatibility with old runtime (#46) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <154887581631.28629.9619547386512327777@gitbox.apache.org> From: csantanapr@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-openwhisk-runtime-python X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: e66143390ac404e5969ac72e2d7c5d849588010f X-Git-Newrev: 993c2ea77a2ecfd2fc247140cd442926c3e98500 X-Git-Rev: 993c2ea77a2ecfd2fc247140cd442926c3e98500 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-runtime-python.git The following commit(s) were added to refs/heads/master by this push: new 993c2ea disabled warnings at import for compatibility with old runtime (#46) 993c2ea is described below commit 993c2ea77a2ecfd2fc247140cd442926c3e98500 Author: Michele Sciabarra <30654959+sciabarracom@users.noreply.github.com> AuthorDate: Wed Jan 30 20:16:52 2019 +0100 disabled warnings at import for compatibility with old runtime (#46) --- core/pythonActionLoop/pythonbuild.py.launcher.py | 4 +++- .../scala/runtime/actionContainers/PythonActionContainerTests.scala | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/pythonActionLoop/pythonbuild.py.launcher.py b/core/pythonActionLoop/pythonbuild.py.launcher.py index b7007c9..360cb55 100755 --- a/core/pythonActionLoop/pythonbuild.py.launcher.py +++ b/core/pythonActionLoop/pythonbuild.py.launcher.py @@ -19,7 +19,7 @@ from sys import stdin from sys import stdout from sys import stderr from os import fdopen -import sys, os, json, traceback +import sys, os, json, traceback, warnings try: # if the directory 'virtualenv' is extracted out of a zip file @@ -39,7 +39,9 @@ except Exception: sys.exit(1) # now import the action as process input/output +warnings.filterwarnings("ignore") from main__ import main as main +warnings.resetwarnings() # if there are some arguments exit immediately if len(sys.argv) >1: diff --git a/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala b/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala index edc376c..89d2426 100644 --- a/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala +++ b/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala @@ -157,8 +157,8 @@ class PythonActionContainerTests extends BasicActionRunnerTests with WskActorSys Seq("__main__.py") -> """ |def main(args): - | f = open('workfile', 'r') - | return {'file': f.read()} + | with open('workfile', 'r') as f: + | return { 'file': f.read() } """.stripMargin, Seq("workfile") -> "this is a test string")