Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions ebuildtester/atom.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
"""The Atom class represents a single atom.

Raises:
AtomException: An AtomException is raised when an atom is invalid.
"""


class AtomException(Exception):
"""A basic Exception."""
pass


Expand All @@ -16,9 +24,10 @@ def __init__(self, atom):

try:
self.category, self.package = self.atom.split("/")
except ValueError:
except ValueError as exc:
raise AtomException(
"ATOM has to be of the form [=]SECTION/PACKAGE[-VERSION]")
"ATOM has to be of the form [=]SECTION/PACKAGE[-VERSION]") \
from exc

# Split off version.
try:
Expand Down