Skip to content

Commit

Permalink
requirements: Upgrade pyflakes to 2.0.0.
Browse files Browse the repository at this point in the history
We fix a few errors that only the new version finds.
  • Loading branch information
hackerkid authored and timabbott committed May 24, 2018
1 parent 1ef994c commit 54a002c
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion puppet/zulip/files/postgresql/process_fts_updates
Expand Up @@ -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 = ''
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.in
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/lib/provision.py
Expand Up @@ -82,7 +82,7 @@
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:")
Expand Down
2 changes: 1 addition & 1 deletion tools/test-js-with-node
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion zerver/lib/bugdown/__init__.py
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion zerver/lib/validator.py
Expand Up @@ -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]:
Expand Down
2 changes: 1 addition & 1 deletion zerver/tests/test_queue.py
Expand Up @@ -77,7 +77,7 @@ def collect(event: Dict[str, Any]) -> None:

try:
queue_client.start_consuming()
except Exception as e:
except Exception:
queue_client.register_json_consumer("test_suite", collect)
queue_client.start_consuming()

Expand Down
2 changes: 1 addition & 1 deletion zerver/tornado/autoreload.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion zerver/tornado/handlers.py
Expand Up @@ -294,7 +294,7 @@ def get_response(self, request: HttpRequest) -> HttpResponse:
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)
Expand Down
2 changes: 1 addition & 1 deletion zerver/views/unsubscribe.py
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion zilencer/lib/stripe.py
Expand Up @@ -48,7 +48,7 @@ def wrapped(*args: Any, **kwargs: Any) -> Any:
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
Expand Down
2 changes: 1 addition & 1 deletion zproject/email_backends.py
Expand Up @@ -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:
Expand Down

0 comments on commit 54a002c

Please sign in to comment.