mirror of https://github.com/zulip/zulip.git
requirements: Upgrade pyflakes to 2.0.0.
We fix a few errors that only the new version finds.
This commit is contained in:
parent
1ef994c992
commit
54a002c2e2
|
@ -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 = ''
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:")
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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]:
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue