Skip to content

Commit

Permalink
Remove future usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jcristau committed Apr 11, 2023
1 parent 620ca7d commit c916833
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
7 changes: 2 additions & 5 deletions mozilla_version/gecko.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
import attr
import re

from future.utils import raise_from

from mozilla_version.errors import (
PatternNotMatchedError, TooManyTypesError, NoVersionTypeError
)
Expand Down Expand Up @@ -435,11 +433,10 @@ def bump_version_type(self):
try:
return self.__class__(**self._create_bump_version_type_kwargs())
except (ValueError, PatternNotMatchedError) as e:
# TODO Use "raise from" statement once Python 2 support is dropped
raise_from(ValueError(
raise ValueError(
'Cannot bump version type for version "{}". New version number is not valid. '
'Cause: {}'.format(self, e)
), e)
) from e

def _create_bump_version_type_kwargs(self):
bump_version_type_kwargs = {
Expand Down
6 changes: 2 additions & 4 deletions mozilla_version/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import re

from enum import Enum
from future.utils import raise_from

from mozilla_version.errors import MissingFieldError, PatternNotMatchedError
from mozilla_version.parser import (
Expand Down Expand Up @@ -140,10 +139,9 @@ def bump(self, field):
try:
return self.__class__(**self._create_bump_kwargs(field))
except (ValueError, PatternNotMatchedError) as e:
# TODO Use "raise from" statement once Python 2 support is dropped
raise_from(ValueError(
raise ValueError(
'Cannot bump "{}". New version number is not valid. Cause: {}'.format(field, e)
), e)
) from e

def _create_bump_kwargs(self, field):
if field not in self._ALL_NUMBERS:
Expand Down
1 change: 0 additions & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
attrs>=19.2
future
5 changes: 1 addition & 4 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:0cbc8244f71df4bd36c582a4c80da9cee81903db
# SHA1:a19b4a7f9ecfb318d714b82b4c4c501d9ea30586
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -9,6 +9,3 @@ attrs==22.2.0 \
--hash=sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836 \
--hash=sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99
# via -r requirements/base.in
future==0.18.3 \
--hash=sha256:34a17436ed1e96697a86f9de3d15a3b0be01d8bc8de9c1dffd59fb8234ed5307
# via -r requirements/base.in

0 comments on commit c916833

Please sign in to comment.