Merge pull request #872 from ParisNeo/main
Fix ImportError by Removing Redundant Try-Except Block
This commit is contained in:
commit
8891c1b439
2 changed files with 9 additions and 19 deletions
|
|
@ -23,18 +23,13 @@ import pipmaster as pm
|
|||
if not pm.is_installed("neo4j"):
|
||||
pm.install("neo4j")
|
||||
|
||||
try:
|
||||
from neo4j import (
|
||||
AsyncGraphDatabase,
|
||||
exceptions as neo4jExceptions,
|
||||
AsyncDriver,
|
||||
AsyncManagedTransaction,
|
||||
GraphDatabase,
|
||||
)
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"`neo4j` library is not installed. Please install it via pip: `pip install neo4j`."
|
||||
) from e
|
||||
from neo4j import (
|
||||
AsyncGraphDatabase,
|
||||
exceptions as neo4jExceptions,
|
||||
AsyncDriver,
|
||||
AsyncManagedTransaction,
|
||||
GraphDatabase,
|
||||
)
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
config.read("config.ini", "utf-8")
|
||||
|
|
|
|||
|
|
@ -20,13 +20,8 @@ if not pm.is_installed("networkx"):
|
|||
if not pm.is_installed("graspologic"):
|
||||
pm.install("graspologic")
|
||||
|
||||
try:
|
||||
from graspologic import embed
|
||||
import networkx as nx
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"`networkx` library is not installed. Please install it via pip: `pip install networkx`."
|
||||
) from e
|
||||
from graspologic import embed
|
||||
import networkx as nx
|
||||
|
||||
|
||||
@final
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue