diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-10-08 13:34:40 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-10-08 13:34:40 +0200 |
commit | e0f577f3c26fc7c44ce33e2851e245c66af401a0 (patch) | |
tree | 94f5559b09e049235cef6d75c054f84544892fd9 /lbup | |
parent | d81377a37c84187ca8962665dbfae51f9c0c4a6a (diff) |
_path: improve parameter validation
Diffstat (limited to 'lbup')
-rw-r--r-- | lbup/_path.py | 4 |
1 files changed, 2 insertions, 2 deletions
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): |