33import six
44
55
6- @six .python_2_unicode_compatible
76class TestgresException (Exception ):
8- def __str__ (self ):
9- s = super (TestgresException , self ).__str__ ()
10- return six .text_type (s )
7+ pass
118
129
10+ @six .python_2_unicode_compatible
1311class ExecUtilException (TestgresException ):
1412 def __init__ (self ,
1513 message = None ,
@@ -30,17 +28,18 @@ def __str__(self):
3028 msg .append (self .message )
3129
3230 if self .command :
33- msg .append ('Command: {}' .format (self .command ))
31+ msg .append (u 'Command: {}' .format (self .command ))
3432
3533 if self .exit_code :
36- msg .append ('Exit code: {}' .format (self .exit_code ))
34+ msg .append (u 'Exit code: {}' .format (self .exit_code ))
3735
3836 if self .out :
39- msg .append ('----\n {}' .format (self .out ))
37+ msg .append (u '----\n {}' .format (self .out ))
4038
4139 return six .text_type ('\n ' ).join (msg )
4240
4341
42+ @six .python_2_unicode_compatible
4443class QueryException (TestgresException ):
4544 def __init__ (self , message = None , query = None ):
4645 super (QueryException , self ).__init__ (message )
@@ -55,7 +54,7 @@ def __str__(self):
5554 msg .append (self .message )
5655
5756 if self .query :
58- msg .append ('Query: {}' .format (self .query ))
57+ msg .append (u 'Query: {}' .format (self .query ))
5958
6059 return six .text_type ('\n ' ).join (msg )
6160
@@ -68,6 +67,7 @@ class CatchUpException(QueryException):
6867 pass
6968
7069
70+ @six .python_2_unicode_compatible
7171class StartNodeException (TestgresException ):
7272 def __init__ (self , message = None , files = None ):
7373 super (StartNodeException , self ).__init__ (message )
@@ -81,8 +81,8 @@ def __str__(self):
8181 if self .message :
8282 msg .append (self .message )
8383
84- for key , value in six . iteritems ( self .files or {}) :
85- msg .append ('{}\n ----\n {}\n ' .format (key , value ))
84+ for f , lines in self .files or [] :
85+ msg .append (u '{}\n ----\n {}\n ' .format (f , lines ))
8686
8787 return six .text_type ('\n ' ).join (msg )
8888
0 commit comments