Skip to content

Commit 70361bd

Browse files
committed
Resolved pylint redefined-variable-type warnings
1 parent 1c68d8d commit 70361bd

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
@@ -2032,7 +2032,7 @@ def click_pushButtonSend(self):
20322032
# attempt register
20332033
if email[-14:] != "@mailchuck.com":
20342034
# 12 character random email address
2035-
email = ''.join(
2035+
email = u''.join(
20362036
random.SystemRandom().choice(
20372037
string.ascii_lowercase
20382038
) for _ in range(12)
@@ -2048,78 +2048,77 @@ def click_pushButtonSend(self):
20482048
" an email gateway. Sending registration"
20492049
" now as {0}, please wait for the registration"
20502050
" to be processed before retrying sending."
2051-
).format(email)
2052-
)
2051+
).format(email))
20532052
return
20542053
status, addressVersionNumber, streamNumber, ripe = \
20552054
decodeAddress(toAddress)
20562055
if status != 'success':
20572056
try:
2058-
toAddress = unicode(toAddress, 'utf-8', 'ignore')
2057+
toAddress_value = unicode(
2058+
toAddress, 'utf-8', 'ignore')
20592059
except:
20602060
logger.warning(
2061-
"Failed unicode(toAddress ):",
2062-
exc_info=True)
2061+
"Failed unicode(toAddress ):", exc_info=True)
20632062
logger.error(
20642063
'Error: Could not decode recipient address %s: %s',
2065-
toAddress, status)
2064+
toAddress_value, status)
20662065

20672066
if status == 'missingbm':
20682067
self.updateStatusBar(_translate(
20692068
"MainWindow",
20702069
"Error: Bitmessage addresses start with"
20712070
" BM- Please check the recipient address {0}"
2072-
).format(toAddress))
2071+
).format(toAddress_value))
20732072
elif status == 'checksumfailed':
20742073
self.updateStatusBar(_translate(
20752074
"MainWindow",
20762075
"Error: The recipient address {0} is not"
20772076
" typed or copied correctly. Please check it."
2078-
).format(toAddress))
2077+
).format(toAddress_value))
20792078
elif status == 'invalidcharacters':
20802079
self.updateStatusBar(_translate(
20812080
"MainWindow",
20822081
"Error: The recipient address {0} contains"
20832082
" invalid characters. Please check it."
2084-
).format(toAddress))
2083+
).format(toAddress_value))
20852084
elif status == 'versiontoohigh':
20862085
self.updateStatusBar(_translate(
20872086
"MainWindow",
20882087
"Error: The version of the recipient address"
20892088
" {0} is too high. Either you need to upgrade"
20902089
" your Bitmessage software or your"
20912090
" acquaintance is being clever."
2092-
).format(toAddress))
2091+
).format(toAddress_value))
20932092
elif status == 'ripetooshort':
20942093
self.updateStatusBar(_translate(
20952094
"MainWindow",
20962095
"Error: Some data encoded in the recipient"
20972096
" address {0} is too short. There might be"
20982097
" something wrong with the software of"
20992098
" your acquaintance."
2100-
).format(toAddress))
2099+
).format(toAddress_value))
21012100
elif status == 'ripetoolong':
21022101
self.updateStatusBar(_translate(
21032102
"MainWindow",
21042103
"Error: Some data encoded in the recipient"
21052104
" address {0} is too long. There might be"
21062105
" something wrong with the software of"
21072106
" your acquaintance."
2108-
).format(toAddress))
2107+
).format(toAddress_value))
21092108
elif status == 'varintmalformed':
21102109
self.updateStatusBar(_translate(
21112110
"MainWindow",
21122111
"Error: Some data encoded in the recipient"
21132112
" address {0} is malformed. There might be"
21142113
" something wrong with the software of"
21152114
" your acquaintance."
2116-
).format(toAddress))
2115+
).format(toAddress_value))
21172116
else:
21182117
self.updateStatusBar(_translate(
21192118
"MainWindow",
21202119
"Error: Something is wrong with the"
21212120
" recipient address {0}."
2122-
).format(toAddress))
2121+
).format(toAddress_value))
21232122
elif fromAddress == '':
21242123
self.updateStatusBar(_translate(
21252124
"MainWindow",
@@ -4312,6 +4311,8 @@ def tableWidgetInboxItemClicked(self):
43124311
except NameError:
43134312
message = u""
43144313
except IndexError:
4314+
# _translate() often returns unicode, no redefinition here!
4315+
# pylint: disable=redefined-variable-type
43154316
message = _translate(
43164317
"MainWindow",
43174318
"Error occurred: could not load message from disk."

0 commit comments

Comments
 (0)