Skip to content

Commit 51c3abf

Browse files
committed
Resolved pylint redefined-variable-type warnings
1 parent 0a26d01 commit 51c3abf

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/bitmessageqt/__init__.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ def click_pushButtonSend(self):
20332033
# attempt register
20342034
if email[-14:] != "@mailchuck.com":
20352035
# 12 character random email address
2036-
email = ''.join(
2036+
email = u''.join(
20372037
random.SystemRandom().choice(
20382038
string.ascii_lowercase
20392039
) for _ in range(12)
@@ -2049,78 +2049,77 @@ def click_pushButtonSend(self):
20492049
" an email gateway. Sending registration"
20502050
" now as {0}, please wait for the registration"
20512051
" to be processed before retrying sending."
2052-
).format(email)
2053-
)
2052+
).format(email))
20542053
return
20552054
status, addressVersionNumber, streamNumber, ripe = \
20562055
decodeAddress(toAddress)
20572056
if status != 'success':
20582057
try:
2059-
toAddress = unicode(toAddress, 'utf-8', 'ignore')
2058+
toAddress_value = unicode(
2059+
toAddress, 'utf-8', 'ignore')
20602060
except:
20612061
logger.warning(
2062-
"Failed unicode(toAddress ):",
2063-
exc_info=True)
2062+
"Failed unicode(toAddress ):", exc_info=True)
20642063
logger.error(
20652064
'Error: Could not decode recipient address %s: %s',
2066-
toAddress, status)
2065+
toAddress_value, status)
20672066

20682067
if status == 'missingbm':
20692068
self.updateStatusBar(_translate(
20702069
"MainWindow",
20712070
"Error: Bitmessage addresses start with"
20722071
" BM- Please check the recipient address {0}"
2073-
).format(toAddress))
2072+
).format(toAddress_value))
20742073
elif status == 'checksumfailed':
20752074
self.updateStatusBar(_translate(
20762075
"MainWindow",
20772076
"Error: The recipient address {0} is not"
20782077
" typed or copied correctly. Please check it."
2079-
).format(toAddress))
2078+
).format(toAddress_value))
20802079
elif status == 'invalidcharacters':
20812080
self.updateStatusBar(_translate(
20822081
"MainWindow",
20832082
"Error: The recipient address {0} contains"
20842083
" invalid characters. Please check it."
2085-
).format(toAddress))
2084+
).format(toAddress_value))
20862085
elif status == 'versiontoohigh':
20872086
self.updateStatusBar(_translate(
20882087
"MainWindow",
20892088
"Error: The version of the recipient address"
20902089
" {0} is too high. Either you need to upgrade"
20912090
" your Bitmessage software or your"
20922091
" acquaintance is being clever."
2093-
).format(toAddress))
2092+
).format(toAddress_value))
20942093
elif status == 'ripetooshort':
20952094
self.updateStatusBar(_translate(
20962095
"MainWindow",
20972096
"Error: Some data encoded in the recipient"
20982097
" address {0} is too short. There might be"
20992098
" something wrong with the software of"
21002099
" your acquaintance."
2101-
).format(toAddress))
2100+
).format(toAddress_value))
21022101
elif status == 'ripetoolong':
21032102
self.updateStatusBar(_translate(
21042103
"MainWindow",
21052104
"Error: Some data encoded in the recipient"
21062105
" address {0} is too long. There might be"
21072106
" something wrong with the software of"
21082107
" your acquaintance."
2109-
).format(toAddress))
2108+
).format(toAddress_value))
21102109
elif status == 'varintmalformed':
21112110
self.updateStatusBar(_translate(
21122111
"MainWindow",
21132112
"Error: Some data encoded in the recipient"
21142113
" address {0} is malformed. There might be"
21152114
" something wrong with the software of"
21162115
" your acquaintance."
2117-
).format(toAddress))
2116+
).format(toAddress_value))
21182117
else:
21192118
self.updateStatusBar(_translate(
21202119
"MainWindow",
21212120
"Error: Something is wrong with the"
21222121
" recipient address {0}."
2123-
).format(toAddress))
2122+
).format(toAddress_value))
21242123
elif fromAddress == '':
21252124
self.updateStatusBar(_translate(
21262125
"MainWindow",
@@ -4313,6 +4312,8 @@ def tableWidgetInboxItemClicked(self):
43134312
except NameError:
43144313
message = u""
43154314
except IndexError:
4315+
# _translate() often returns unicode, no redefinition here!
4316+
# pylint: disable=redefined-variable-type
43164317
message = _translate(
43174318
"MainWindow",
43184319
"Error occurred: could not load message from disk."

0 commit comments

Comments
 (0)