Skip to content

Commit

Permalink
Replace logging.warn usage with logging.warning
Browse files Browse the repository at this point in the history
logging.warn is an alias to logging.warning since Python 3.3 and
will be removed in Python 3.13.
  • Loading branch information
jelly committed Apr 27, 2024
1 parent a3f6f6a commit 4fb3d6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion afew/MailMover.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def move(self, maildir, rules):
shutil.copy2(fname, self.get_new_name(fname, destination))
to_delete_fnames.append(fname)
except shutil.SameFileError:
logging.warn("trying to move '{}' onto itself".format(fname))
logging.warning("trying to move '{}' onto itself".format(fname))
continue
except shutil.Error as e:
# this is ugly, but shutil does not provide more
Expand Down
6 changes: 3 additions & 3 deletions afew/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ def new_mail(message):
filter_.run('id:"{}"'.format(message.get_message_id()))
filter_.commit(self.options.dry_run)
except Exception as e:
logging.warn('Error processing mail with filter {!r}: {}'.format(filter_.message, e))
logging.warning('Error processing mail with filter {!r}: {}'.format(filter_.message, e))

try:
self.database.add_message(event.pathname,
sync_maildir_flags=True,
new_mail_handler=new_mail)
except notmuch.FileError as e:
logging.warn('Error opening mail file: {}'.format(e))
logging.warning('Error opening mail file: {}'.format(e))
return
except notmuch.FileNotEmailError as e:
logging.warn('File does not look like an email: {}'.format(e))
logging.warning('File does not look like an email: {}'.format(e))
return
else:
if src_pathname:
Expand Down

0 comments on commit 4fb3d6d

Please sign in to comment.