From e0f577f3c26fc7c44ce33e2851e245c66af401a0 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 8 Oct 2023 13:34:40 +0200 Subject: _path: improve parameter validation --- lbup/_path.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lbup') diff --git a/lbup/_path.py b/lbup/_path.py index 26c67f8..27f7072 100644 --- a/lbup/_path.py +++ b/lbup/_path.py @@ -2,8 +2,8 @@ class AbsPath: _components = None def __init__(self, path = None, components = None): - if path is not None and components is not None: - raise ValueError('Both path and components provided') + if (path is None) == (components is None): + raise ValueError('Exactly one of path or components must be provided') if path is not None: if isinstance(path, str): -- cgit v1.2.3