def to_python(self, value):
        if value in validators.EMPTY_VALUES:
            return None
        if isinstance(value, list):
            if len(value) != 2:
                raise ValidationError(self.error_messages['invalid'])
            if value[0] in validators.EMPTY_VALUES and value[1] in \
                    validators.EMPTY_VALUES:
                return None

        min = None
        max = None
        if value[0] not in validators.EMPTY_VALUES:
            try:
                min = int(value[0])
            except (TypeError, ValueError):
                raise exceptions.ValidationError(self.error_messages['invalid'])
        if value[1] not in validators.EMPTY_VALUES:
            try:
                max = int(value[1])
            except (TypeError, ValueError):
                raise exceptions.ValidationError(self.error_messages['invalid'])

        return (min, max)
dataset/ETHPy150Open praekelt/django-export/export/fields.py/IntegerField.to_python/original