1
- from traceback import format_exc
2
-
3
1
import six
4
2
from six import python_2_unicode_compatible
5
3
6
4
from mpilot .exceptions import ProgramError
7
5
8
6
if six .PY3 :
9
- from typing import Tuple
7
+ from typing import Tuple # noqa: F401 (used for typing)
10
8
11
9
12
10
@python_2_unicode_compatible
@@ -35,11 +33,7 @@ def __init__(self, problem, solution=None, lineno=None):
35
33
super (InvalidDataFile , self ).__init__ (lineno )
36
34
37
35
self .problem = problem
38
- self .solution = (
39
- solution
40
- if solution is not None
41
- else "Solution: Double check the data file."
42
- )
36
+ self .solution = solution if solution is not None else "Solution: Double check the data file."
43
37
44
38
def __str__ (self ):
45
39
return "\n " .join (("Problem: " + self .problem , "Solution: " + self .solution ))
@@ -48,9 +42,7 @@ def __str__(self):
48
42
@python_2_unicode_compatible
49
43
class EmptyInputs (ProgramError ):
50
44
def __str__ (self ):
51
- return "\n " .join (
52
- ("Problem: The input data is empty." , "Solution: Double check data inputs." )
53
- )
45
+ return "\n " .join (("Problem: The input data is empty." , "Solution: Double check data inputs." ))
54
46
55
47
56
48
@python_2_unicode_compatible
@@ -116,9 +108,7 @@ def __init__(self, len_a, len_b, lineno=None):
116
108
def __str__ (self ):
117
109
return "\n " .join (
118
110
(
119
- "Problem: Array lengths don't match: {} and {}" .format (
120
- self .len_a , self .len_b
121
- ),
111
+ "Problem: Array lengths don't match: {} and {}" .format (self .len_a , self .len_b ),
122
112
"Solution: Make sure that the array lengths are equal." ,
123
113
)
124
114
)
0 commit comments