Skip to content

Commit

Permalink
fix multiple warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
  • Loading branch information
arthurzam committed Mar 1, 2024
1 parent 83fc32c commit 1646e9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions bugz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,11 @@ def post(settings):
# load description from file if possible
if hasattr(settings, 'description_from'):
try:
if settings.description_from == '-':
settings.description = sys.stdin.read()
else:
settings.description = \
open(settings.description_from, 'r').read()
if settings.description_from == '-':
settings.description = sys.stdin.read()
else:
settings.description = \
open(settings.description_from, 'r').read()
except IOError as error:
raise BugzError('Unable to read from file: %s: %s' %
(settings.description_from, error))
Expand Down
4 changes: 2 additions & 2 deletions bugz/cli_argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ def make_arg_parser():
modify_parser.add_argument('-U', '--url',
help='set URL field of bug')
modify_parser.add_argument('-v', '--version',
help='set the version for this bug'),
help='set the version for this bug')
modify_parser.add_argument('-w', '--whiteboard',
help='set Status whiteboard'),
help='set Status whiteboard')
modify_parser.add_argument('--fixed',
action='store_true',
help='mark bug as RESOLVED, FIXED')
Expand Down
12 changes: 6 additions & 6 deletions bugz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
def get_content_type(filename):
# Keep in sync with Lib/mimetypes.py
encoding_map = {
'bzip2': 'application/x-bzip2',
'compress': 'application/x-compress',
'gzip': 'application/gzip',
'xz': 'application/x-xz',
}
'bzip2': 'application/x-bzip2',
'compress': 'application/x-compress',
'gzip': 'application/gzip',
'xz': 'application/x-xz',
}
# Last addition was brotli, rest have been since 3.4
if sys.version_info[0:2] >= (3, 9):
if sys.version_info >= (3, 9):
encoding_map['br'] = 'application/x-brotli'

mimetype, encoding = mimetypes.guess_type(filename) or ('application/octet-stream', None)
Expand Down

0 comments on commit 1646e9a

Please sign in to comment.