Remove Py4JError catch since we no longer attempt to call java api for the users.
@@ -4,7 +4,6 @@ import os
import logging
from py4j.java_gateway import JavaGateway, CallbackServerParameters, JavaObject, JavaClass, JVMView, java_import
from py4j.java_collections import JavaList, JavaArray, JavaSet, JavaMap
-from py4j.protocol import Py4JError
from typing import Dict, Any, Iterable, List, Collection, Set
from _io import TextIOWrapper
@@ -69,12 +68,12 @@ class KeanuContext(metaclass=Singleton):
for (k, v) in python_map.items():
try:
new_k = k.unwrap()
- except (AttributeError, Py4JError):
+ except (AttributeError):
new_k = k
try:
new_v = v.unwrap()
- except (AttributeError, Py4JError):
+ except (AttributeError):
new_v = v
m.put(new_k, new_v)
@@ -87,7 +86,7 @@ class KeanuContext(metaclass=Singleton):
for o in l:
try:
o = o.unwrap()
- except (AttributeError, Py4JError):
+ except (AttributeError):
pass
lst.add(o)
