Skip to content

Commit

Permalink
Merge pull request #344 from jelly/logging-warn-deprecated
Browse files Browse the repository at this point in the history
Replace logging.warn usage with logging.warning
  • Loading branch information
GuillaumeSeren authored May 31, 2024
2 parents a3f6f6a + 4fb3d6d commit 65227fa
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 65227fa

Please sign in to comment.