Mercurial > public > mercurial-scm > hg-stable
diff mercurial/archival.py @ 52625:cd7dcccc3327
archival: use str for a ValueError argument
Builtin exceptions generally use str, and this was probably a side effect of the
mass-byteification a few years ago. While we're here, specify that the type
needs to be bytes, since that's what's checked. Maybe this was meant to be a
ProgrammingError- IDK that showing this to the user is helpful in any way.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 04 Dec 2024 22:29:17 -0500 |
parents | f4733654f144 |
children | 1756f5a788fd |
line wrap: on
line diff
--- a/mercurial/archival.py Thu Jan 02 14:57:40 2025 +0100 +++ b/mercurial/archival.py Wed Dec 04 22:29:17 2024 -0500 @@ -56,7 +56,7 @@ prefix = util.normpath(prefix) else: if not isinstance(dest, bytes): - raise ValueError(b'dest must be string if no prefix') + raise ValueError('dest must be bytes if no prefix') prefix = os.path.basename(dest) lower = prefix.lower() for sfx in exts.get(kind, []):