diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-10-05 14:04:41 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-10-05 14:04:41 +0200 |
| commit | 6100010d6873845413aed22744470616992df603 (patch) | |
| tree | 5cefcd46851d06e0d9e9b09f578c13649582d075 /src/philo/log.py | |
| parent | 8a351c6d267c55445de7b7b40b1de3b16305bd02 (diff) | |
| download | philosophers_test-6100010d6873845413aed22744470616992df603.tar.gz philosophers_test-6100010d6873845413aed22744470616992df603.tar.bz2 philosophers_test-6100010d6873845413aed22744470616992df603.zip | |
Readded should be dead test
Diffstat (limited to 'src/philo/log.py')
| -rw-r--r-- | src/philo/log.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/philo/log.py b/src/philo/log.py index 14bdd75..a07b734 100644 --- a/src/philo/log.py +++ b/src/philo/log.py @@ -6,14 +6,15 @@ # By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/10/01 10:51:39 by cacharle #+# #+# # -# Updated: 2020/10/01 14:19:29 by cacharle ### ########.fr # +# Updated: 2020/10/05 13:52:51 by cacharle ### ########.fr # # # # ############################################################################ # import re -from .event import Event -from . import error +from philo.event import Event +import philo + class Log: def __init__(self, line: str, philo_num, start_time, end_time): @@ -24,7 +25,7 @@ class Log: line ) if match is None: - raise error.Format(line, "wrong format") + raise philo.error.Format(line, "wrong format") self._line = line self.id = self._parse_ranged_int(match.group("id"), 1, philo_num) @@ -37,10 +38,12 @@ class Log: try: value = int(s) if not (lo <= value <= hi): - raise error.Format(self._line, - "{} should be between {} - {}".format(s, lo, hi)) + raise philo.error.Format( + self._line, + "{} should be between {} - {}".format(s, lo, hi) + ) except ValueError: - raise error.Format(self._line, "{} sould be an integer".format(s)) + raise philo.error.Format(self._line, "{} sould be an integer".format(s)) return value def __repr__(self): |
