Skip to content

Commit acac414

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 26b8578 commit acac414

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

linopy/solvers.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from __future__ import annotations
77

88
import contextlib
9-
import importlib.util
109
import enum
10+
import importlib.util
1111
import io
1212
import logging
1313
import os
@@ -332,7 +332,10 @@ def __init__(
332332
super().__init__(**solver_options)
333333

334334
def check_solver_installation(self, package_name):
335-
if sub.run([which, "cbc"], stdout=sub.DEVNULL, stderr=sub.STDOUT).returncode != 0:
335+
if (
336+
sub.run([which, "cbc"], stdout=sub.DEVNULL, stderr=sub.STDOUT).returncode
337+
!= 0
338+
):
336339
msg = f"Solver package '{package_name}' is not installed. Please install first to initialize solver instance."
337340
raise ImportError(msg)
338341

@@ -497,7 +500,10 @@ def __init__(
497500
super().__init__(**solver_options)
498501

499502
def check_solver_installation(self, package_name):
500-
if sub.run([which, "glpsol"], stdout=sub.DEVNULL, stderr=sub.STDOUT).returncode != 0:
503+
if (
504+
sub.run([which, "glpsol"], stdout=sub.DEVNULL, stderr=sub.STDOUT).returncode
505+
!= 0
506+
):
501507
msg = f"Solver package '{package_name}' is not installed. Please install first to initialize solver instance."
502508
raise ImportError(msg)
503509

0 commit comments

Comments
 (0)