requirements: Upgrade pyflakes to 2.0.0.

We fix a few errors that only the new version finds.
This commit is contained in:
Vishnu Ks 2018-05-24 14:41:34 +00:00 committed by Tim Abbott
parent 1ef994c992
commit 54a002c2e2
13 changed files with 13 additions and 13 deletions

View File

@ -67,7 +67,7 @@ try:
from django.conf import settings
remote_postgres_host = settings.REMOTE_POSTGRES_HOST
USING_PGROONGA = settings.USING_PGROONGA
except ImportError as e:
except ImportError:
# process_fts_updates also supports running locally on a remote
# postgres server; in that case, one can just connect to localhost
remote_postgres_host = ''

View File

@ -29,7 +29,7 @@ isort==4.3.4
pycodestyle==2.4.0
# Needed to run pyflakes linter
pyflakes==1.6.0
pyflakes==2.0.0
# Needed to run tests in parallel
tblib==1.3.2

View File

@ -118,7 +118,7 @@ pycodestyle==2.4.0
pycparser==2.18 # via cffi
pycrypto==2.6.1
pydispatcher==2.0.5 # via scrapy
pyflakes==1.6.0
pyflakes==2.0.0
pygments==2.2.0
pyjwt==1.6.1
pyldap==3.0.0.post1 # via fakeldap

View File

@ -82,7 +82,7 @@ try:
os.path.join(VAR_DIR_PATH, 'zulip-test-symlink')
)
os.remove(os.path.join(VAR_DIR_PATH, 'zulip-test-symlink'))
except OSError as err:
except OSError:
print(FAIL + "Error: Unable to create symlinks."
"Make sure you have permission to create symbolic links." + ENDC)
print("See this page for more information:")

View File

@ -141,7 +141,7 @@ try:
except OSError:
print('Bad command: %s' % (command,))
raise
except subprocess.CalledProcessError as e:
except subprocess.CalledProcessError:
print('\n** Tests failed, PLEASE FIX! **\n')
sys.exit(1)

View File

@ -297,7 +297,7 @@ def fetch_tweet_data(tweet_id: str) -> Optional[Dict[str, Any]]:
logging.error('Unable to load twitter api, you may have the wrong '
'library installed, see https://github.com/zulip/zulip/issues/86')
return None
except TimeoutExpired as e:
except TimeoutExpired:
# We'd like to try again later and not cache the bad result,
# so we need to re-raise the exception (just as though
# we were being rate-limited)

View File

@ -205,7 +205,7 @@ def check_url(var_name: str, val: object) -> Optional[str]:
try:
validate(val)
return None
except ValidationError as err:
except ValidationError:
return _('%s is not a URL') % (var_name,)
def validate_field_data(field_data: ProfileFieldData) -> Optional[str]:

View File

@ -77,7 +77,7 @@ class TestQueueImplementation(ZulipTestCase):
try:
queue_client.start_consuming()
except Exception as e:
except Exception:
queue_client.register_json_consumer("test_suite", collect)
queue_client.start_consuming()

View File

@ -187,7 +187,7 @@ def _check_file(modify_times, module, path):
try:
importlib.reload(module)
except Exception as e:
except Exception:
gen_log.error("Error importing %s, not reloading" % (path,))
traceback.print_exc()
return False

View File

@ -294,7 +294,7 @@ class AsyncDjangoHandlerBase(tornado.web.RequestHandler, base.BaseHandler): # n
except SystemExit:
# See https://code.djangoproject.com/ticket/4701
raise
except Exception as e:
except Exception:
exc_info = sys.exc_info()
signals.got_request_exception.send(sender=self.__class__, request=request)
return self.handle_uncaught_exception(request, resolver, exc_info)

View File

@ -14,7 +14,7 @@ def process_unsubscribe(request: HttpRequest, confirmation_key: str, subscriptio
unsubscribe_function: Callable[[UserProfile], None]) -> HttpResponse:
try:
user_profile = get_object_from_key(confirmation_key, Confirmation.UNSUBSCRIBE)
except ConfirmationKeyException as exception:
except ConfirmationKeyException:
return render(request, 'zerver/unsubscribe_link_error.html')
unsubscribe_function(user_profile)

View File

@ -48,7 +48,7 @@ def catch_stripe_errors(func: CallableT) -> CallableT:
raise StripeError(
_("Something went wrong. Please try again or email us at %s.")
% (settings.ZULIP_ADMINISTRATOR,))
except Exception as e:
except Exception:
billing_logger.exception("Uncaught error in Stripe integration")
raise
return wrapped # type: ignore # https://github.com/python/mypy/issues/1927

View File

@ -17,7 +17,7 @@ def get_forward_address() -> str:
config.read(settings.FORWARD_ADDRESS_CONFIG_FILE)
try:
return config.get("DEV_EMAIL", "forward_address")
except (configparser.NoSectionError, configparser.NoOptionError) as e:
except (configparser.NoSectionError, configparser.NoOptionError):
return ""
def set_forward_address(forward_address: str) -> None: