From 4f534526ca00c6e894f8bc33dbc3ef964ffd273e Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 12 Jul 2016 11:32:48 +0200 Subject: [PATCH] Python 3.2 workaround: Drop usage of enum module enum is not yet available in Python 3.2, but as long as snakefruit still runs Ubuntu 12.04 we need to get along without it. --- britney.py | 4 ++-- policies/policy.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/britney.py b/britney.py index 48e1235..55a469d 100755 --- a/britney.py +++ b/britney.py @@ -1755,9 +1755,9 @@ class Britney(object): for policy in self.policies: if suite in policy.applicable_suites: v = policy.apply_policy(policy_info, suite, src, source_t, source_u, excuse) - if v.value > policy_verdict.value: + if v > policy_verdict: policy_verdict = v - if policy_verdict.is_rejected: + if policy_verdict in [PolicyVerdict.REJECTED_PERMANENTLY, PolicyVerdict.REJECTED_TEMPORARILY]: excuse.is_valid = False if suite in ('pu', 'tpu') and source_t: diff --git a/policies/policy.py b/policies/policy.py index bea9747..5dce659 100644 --- a/policies/policy.py +++ b/policies/policy.py @@ -1,5 +1,4 @@ from abc import abstractmethod -from enum import Enum, unique import apt_pkg import os import time @@ -9,8 +8,7 @@ from hints import Hint, split_into_one_hint_per_package from britney_util import ensuredir -@unique -class PolicyVerdict(Enum): +class PolicyVerdict: """""" """ The migration item passed the policy.