@@ -40,7 +40,7 @@ class ConnectionException(RabbitpyException):
40
40
41
41
"""
42
42
def __str__ (self ):
43
- return 'Unable to connect to the remote server %r' % self .args
43
+ return 'Unable to connect to the remote server {}' . format ( self .args )
44
44
45
45
46
46
class ConnectionResetException (RabbitpyException ):
@@ -65,8 +65,8 @@ class RemoteClosedChannelException(RabbitpyException):
65
65
66
66
"""
67
67
def __str__ (self ):
68
- return 'Channel %i was closed by the remote server (%i ): %s' % \
69
- ( self .args [ 0 ], self . args [ 1 ], self . args [ 2 ] )
68
+ return 'Channel {} was closed by the remote server ({} ): {}' . format (
69
+ * self .args )
70
70
71
71
72
72
class RemoteClosedException (RabbitpyException ):
@@ -75,8 +75,8 @@ class RemoteClosedException(RabbitpyException):
75
75
76
76
"""
77
77
def __str__ (self ):
78
- return 'Connection was closed by the remote server (%i ): %s' % \
79
- ( self .args [ 0 ], self . args [ 1 ] )
78
+ return 'Connection was closed by the remote server ({} ): {}' . format (
79
+ * self .args )
80
80
81
81
82
82
class MessageReturnedException (RabbitpyException ):
@@ -85,8 +85,8 @@ class MessageReturnedException(RabbitpyException):
85
85
86
86
"""
87
87
def __str__ (self ):
88
- return 'Message was returned by RabbitMQ: (%s) %s for exchange %s' % \
89
- ( self .args [ 0 ], self . args [ 1 ], self . args [ 2 ] )
88
+ return 'Message was returned by RabbitMQ: ({}) for exchange {}' . format (
89
+ * self .args )
90
90
91
91
92
92
class NoActiveTransactionError (RabbitpyException ):
@@ -113,7 +113,7 @@ class NotSupportedError(RabbitpyException):
113
113
114
114
"""
115
115
def __str__ (self ):
116
- return 'The selected feature "%s " is not supported' % self .args [ 0 ]
116
+ return 'The selected feature "{} " is not supported' . format ( self .args )
117
117
118
118
119
119
class TooManyChannelsError (RabbitpyException ):
@@ -134,8 +134,8 @@ class UnexpectedResponseError(RabbitpyException):
134
134
135
135
"""
136
136
def __str__ (self ):
137
- return 'Received an expected response, expected %s, received %s' % \
138
- ( self .args [ 0 ], self . args [ 1 ] )
137
+ return 'Received an expected response, expected {}, ' \
138
+ 'received {}' . format ( * self .args )
139
139
140
140
141
141
# AMQP Exceptions
0 commit comments