Skip to content

Commit

Permalink
Merge pull request #20 from lsst/tickets/DM-15435
Browse files Browse the repository at this point in the history
DM-15435: Remove python 2 support from pex packages
  • Loading branch information
r-owen committed Aug 15, 2018
2 parents 9884240 + 0de60c5 commit f4e7cdd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.cache/
.pytest_cache
.coverage
pytest_session.txt
_build.*
.sconsign.dblite
config.log
Expand Down
2 changes: 0 additions & 2 deletions python/lsst/pex/exceptions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from __future__ import absolute_import

from .version import *
from .exceptions import *
from .wrappers import *
18 changes: 7 additions & 11 deletions python/lsst/pex/exceptions/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from __future__ import absolute_import

__all__ = ["register", "ExceptionMeta", "Exception", "LogicError",
"DomainError", "InvalidParameterError", "LengthError",
"OutOfRangeError", "RuntimeError", "RangeError", "OverflowError",
"UnderflowError", "NotFoundError", "IoError", "TypeError",
"translate", "declare"]

import warnings
import builtins

from future.utils import with_metaclass
from . import exceptions

registry = {}
Expand All @@ -54,7 +50,7 @@ def __getattr__(self, name):


@register
class Exception(with_metaclass(ExceptionMeta, builtins.Exception)):
class Exception(Exception, metaclass=ExceptionMeta):
"""The base class for Python-wrapped LSST C++ exceptions.
"""

Expand Down Expand Up @@ -110,7 +106,7 @@ class OutOfRangeError(LogicError):


@register
class RuntimeError(Exception, builtins.RuntimeError):
class RuntimeError(Exception, RuntimeError):
WrappedClass = exceptions.RuntimeError


Expand All @@ -120,27 +116,27 @@ class RangeError(RuntimeError):


@register
class OverflowError(RuntimeError, builtins.OverflowError):
class OverflowError(RuntimeError, OverflowError):
WrappedClass = exceptions.OverflowError


@register
class UnderflowError(RuntimeError, builtins.ArithmeticError):
class UnderflowError(RuntimeError, ArithmeticError):
WrappedClass = exceptions.UnderflowError


@register
class NotFoundError(Exception, builtins.LookupError):
class NotFoundError(Exception, LookupError):
WrappedClass = exceptions.NotFoundError


@register
class IoError(RuntimeError, builtins.IOError):
class IoError(RuntimeError, IOError):
WrappedClass = exceptions.IoError


@register
class TypeError(RuntimeError, builtins.TypeError):
class TypeError(RuntimeError, TypeError):
WrappedClass = exceptions.TypeError


Expand Down
2 changes: 0 additions & 2 deletions tests/test_Exception_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from builtins import str

import unittest

import lsst.pex.exceptions
Expand Down
1 change: 0 additions & 1 deletion ups/pex_exceptions.table
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ setupRequired(base)
setupRequired(boost)
setupRequired(pybind11)
setupRequired(python)
setupRequired(python_future)

envPrepend(LD_LIBRARY_PATH, ${PRODUCT_DIR}/lib)
envPrepend(DYLD_LIBRARY_PATH, ${PRODUCT_DIR}/lib)
Expand Down

0 comments on commit f4e7cdd

Please sign in to comment.