# Path: mangopay/exceptions.py
# class CurrencyMismatch(Exception):
#     pass


import copy
import datetime
import decimal
import inspect
import sys
import pytz
import six
    import urllib
from calendar import timegm
from functools import wraps
from .compat import python_2_unicode_compatible
from .exceptions import CurrencyMismatch
    from urllib import request
        return self.__class__(amount, self.currency)

    def __floordiv__(self, other):
        if isinstance(other, Money):
            if other.currency != self.currency:
                raise CurrencyMismatch(self.currency, other.currency, '//')

            if other.amount == 0:
                raise ZeroDivisionError()
            return self.amount // other.amount

        if other == 0:
            raise ZeroDivisionError()

        amount = self.amount // other
        return self.__class__(amount, self.currency)

    def __mod__(self, other):
        if isinstance(other, Money):
            raise TypeError("modulo is unsupported between two '{}' "
                            "objects".format(self.__class__.__name__))
        if other == 0:
            raise ZeroDivisionError()

        amount = self.amount % other
        return self.__class__(amount, self.currency)

    def __divmod__(self, other):
        if isinstance(other, Money):
            if other.currency != self.currency:

# Path: mangopay/exceptions.py
# class CurrencyMismatch(Exception):
#     pass


# Path: mangopay/utils.py
import copy
import datetime
import decimal
import inspect
import sys
import pytz
import six
    import urllib
from calendar import timegm
from functools import wraps
from .compat import python_2_unicode_compatible
from .exceptions import CurrencyMismatch
    from urllib import request

        return self.__class__(amount, self.currency)

    def __floordiv__(self, other):
        if isinstance(other, Money):
            if other.currency != self.currency:
                raise CurrencyMismatch(self.currency, other.currency, '//')

            if other.amount == 0:
                raise ZeroDivisionError()
            return self.amount // other.amount

        if other == 0:
            raise ZeroDivisionError()

        amount = self.amount // other
        return self.__class__(amount, self.currency)

    def __mod__(self, other):
        if isinstance(other, Money):
            raise TypeError("modulo is unsupported between two '{}' "
                            "objects".format(self.__class__.__name__))
        if other == 0:
            raise ZeroDivisionError()

        amount = self.amount % other
        return self.__class__(amount, self.currency)

    def __divmod__(self, other):
        if isinstance(other, Money):
            if other.currency != self.currency:

                raise CurrencyMismatch(self.currency, other.currency, 'divmod')