mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
Fix some 2/3 differences and run pylint with confidence=HIGH
Too many false positives otherwise.
This commit is contained in:
parent
d41602ba83
commit
0a3738cfbc
@ -26,7 +26,7 @@ import sys
|
||||
import ubuntutools.subprocess
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
input = raw_input # noqa
|
||||
input = raw_input # noqa, pylint: disable=undefined-variable
|
||||
|
||||
|
||||
class Question(object):
|
||||
|
@ -199,16 +199,30 @@ Content-Type: text/plain; charset=UTF-8
|
||||
mailserver_port)
|
||||
s = smtplib.SMTP(mailserver_host, mailserver_port)
|
||||
break
|
||||
except socket.error as s:
|
||||
Logger.error('Could not connect to %s:%s: %s (%i)',
|
||||
mailserver_host, mailserver_port, s[1], s[0])
|
||||
return
|
||||
except smtplib.SMTPConnectError as s:
|
||||
Logger.error('Could not connect to %s:%s: %s (%i)',
|
||||
mailserver_host, mailserver_port, s[1], s[0])
|
||||
try:
|
||||
# py2 path
|
||||
# pylint: disable=unsubscriptable-object
|
||||
Logger.error('Could not connect to %s:%s: %s (%i)',
|
||||
mailserver_host, mailserver_port, s[1], s[0])
|
||||
except TypeError:
|
||||
# pylint: disable=no-member
|
||||
Logger.error('Could not connect to %s:%s: %s (%i)',
|
||||
mailserver_host, mailserver_port, s.strerror, s.errno)
|
||||
if s.smtp_code == 421:
|
||||
confirmation_prompt(message='This is a temporary error, press [Enter] '
|
||||
'to retry. Press [Ctrl-C] to abort now.')
|
||||
except socket.error as s:
|
||||
try:
|
||||
# py2 path
|
||||
# pylint: disable=unsubscriptable-object
|
||||
Logger.error('Could not connect to %s:%s: %s (%i)',
|
||||
mailserver_host, mailserver_port, s[1], s[0])
|
||||
except TypeError:
|
||||
# pylint: disable=no-member
|
||||
Logger.error('Could not connect to %s:%s: %s (%i)',
|
||||
mailserver_host, mailserver_port, s.strerror, s.errno)
|
||||
return
|
||||
|
||||
if mailserver_user and mailserver_pass:
|
||||
try:
|
||||
|
@ -38,7 +38,7 @@ class PylintTestCase(unittest.TestCase):
|
||||
else:
|
||||
pylint_binary = 'pylint'
|
||||
cmd = [pylint_binary, '--rcfile=ubuntutools/test/pylint.conf', '-E',
|
||||
'--reports=n', '--'] + files
|
||||
'--reports=n', '--confidence=HIGH', '--'] + files
|
||||
sys.stderr.write("Running following command:\n{}\n".format(" ".join(cmd)))
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, close_fds=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user