Skip to content

Commit

Permalink
Replace deprecated calls to warn
Browse files Browse the repository at this point in the history
Fixes:

```
DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
```

when running with:

```
export PYTHONWARNINGS="always::DeprecationWarning"
```

Signed-off-by: Sandro Bonazzola <[email protected]>
  • Loading branch information
sandrobonazzola committed Sep 13, 2023
1 parent c38d318 commit 3ff2507
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion did/plugins/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def commits(self, user, options):
return commits
else:
log.debug(errors.strip())
log.warn("Unable to check commits in '{0}'".format(self.path))
log.warning("Unable to check commits in '{0}'".format(self.path))
return []


Expand Down
4 changes: 2 additions & 2 deletions did/plugins/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@ def session(self):
delta = (
expiring_at.astimezone() - datetime.now().astimezone())
if delta.days < self.token_expiration:
log.warn(
log.warning(
f"Jira token '{self.token_name}' "
f"expires in {delta.days} days.")
except (requests.exceptions.HTTPError,
KeyError, ValueError) as error:
log.warn(error)
log.warning(error)
return self._session
2 changes: 1 addition & 1 deletion did/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def __init__(cls, name, bases, attrs):

if plugin_name in registry:
orig = registry[plugin_name]
log.warn("%s overriding %s" % (cls.__module__, orig.__module__))
log.warning("%s overriding %s" % (cls.__module__, orig.__module__))

registry[plugin_name] = cls

Expand Down

0 comments on commit 3ff2507

Please sign in to comment.