Skip to content

Commit

Permalink
autopep8.sh applied
Browse files Browse the repository at this point in the history
  • Loading branch information
AHReccese committed Aug 19, 2024
1 parent b866b38 commit a3c2133
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions reserver/reserver_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .util import has_named_parameter, remove_dir, read_json
from .reserver_func import does_package_exist, generate_template_setup_py


class PyPIUploader:
"""
The Reserver PyPIUploader class reserves a package name by uploading a template repo to pypi account.
Expand Down Expand Up @@ -43,7 +44,7 @@ def batch_upload(self, names, user_params_path=None):
:return: Number of successfully reserved packages
"""
reserved_successfully = 0
if user_params_path == None:
if user_params_path is None:
for name in names:
if self.upload(name):
reserved_successfully += 1
Expand Down Expand Up @@ -78,9 +79,9 @@ def upload(self, package_name, user_parameters=None):
print("This package already exists in PyPI.")
return False

if user_parameters != None:
if user_parameters is not None:
user_parameters = read_json(user_parameters)

generate_template_setup_py(package_name, user_parameters)

environ["TWINE_USERNAME"] = self.username
Expand Down Expand Up @@ -123,7 +124,7 @@ def upload(self, package_name, user_parameters=None):
error = e.output
try:
error = error.decode(chardet.detect(error)['encoding'])
except:
except BaseException:
error = error.decode('utf-8')
if command == commands[-2]:
if "403" in error and "Invalid or non-existent authentication information" in error:
Expand Down
1 change: 1 addition & 0 deletions reserver/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .reserver_errors import ReserverBaseError
from .reserver_param import INVALID_CONFIG_FILE_NAME_ERROR, PARAM_FILE_DOES_NOT_EXIST_ERROR


def has_named_parameter(func, param_name):
"""
Check whether the given function has a parameter named param_name or not.
Expand Down

0 comments on commit a3c2133

Please sign in to comment.