From 709295281e8d5d185e8e0430487b31499511ca0f Mon Sep 17 00:00:00 2001 From: Fariz Rahman Date: Thu, 12 Dec 2019 12:10:29 +0530 Subject: [PATCH] suppress err (#123) --- .../main/java/org/datavec/python/PythonExecutioner.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datavec/datavec-python/src/main/java/org/datavec/python/PythonExecutioner.java b/datavec/datavec-python/src/main/java/org/datavec/python/PythonExecutioner.java index 0f926b9ad..8afec3b5a 100644 --- a/datavec/datavec-python/src/main/java/org/datavec/python/PythonExecutioner.java +++ b/datavec/datavec-python/src/main/java/org/datavec/python/PythonExecutioner.java @@ -1112,7 +1112,7 @@ public class PythonExecutioner { FileUtils.write(new File(dest), patch, "utf-8"); } catch(IOException e){ - throw new RuntimeException("Error reading resource."); + log.warn("Error patching numpy: " + e); } } @@ -1120,12 +1120,12 @@ public class PythonExecutioner { try { return FileUtils.readFileToString(new File(dest), "utf-8").startsWith("#patch"); } catch (IOException e) { - throw new RuntimeException("Error patching numpy"); - + return false; } } private static void applyPatches() { + // We patch numpy for partial support of multiple interpreters for (String[] patch : _getPatches()){ if (_checkPatchApplied(patch[1])){ log.info("Patch already applied for " + patch[1]); @@ -1137,7 +1137,7 @@ public class PythonExecutioner { } for (String[] patch: _getPatches()){ if (!_checkPatchApplied(patch[1])){ - throw new RuntimeException("Error patching numpy"); + log.warn("Error patching numpy"); } } }