Skip to content

Commit 1ebbdf8

Browse files
committed
New release
1 parent 3031357 commit 1ebbdf8

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

codext/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.11.5
1+
1.11.6

codext/__common__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"isb", "generate_strings_from_regex", "get_alphabet_from_mask", "handle_error", "is_native",
3838
"list_categories", "list_encodings", "list_macros", "lookup", "maketrans", "os", "rank", "re", "register",
3939
"remove", "reset", "s2i", "search", "stopfunc", "BytesIO", "_input", "_stripl", "CodecMacro",
40-
"DARWIN", "LANG", "LINUX", "MASKS", "PY3", "UNIX", "WINDOWS"]
40+
"ParameterError", "DARWIN", "LANG", "LINUX", "MASKS", "PY3", "UNIX", "WINDOWS"]
4141
CODECS_REGISTRY = None
4242
CODECS_OVERWRITTEN = []
4343
CODECS_CATEGORIES = ["native", "custom"]
@@ -145,6 +145,9 @@ def __repr__(self):
145145
return "<codext.CodecMacro object for encoding %s at %#x>" % (self.name, id(self))
146146

147147

148+
class ParameterError(ValueError):
149+
__module__ = Exception.__module__
150+
148151
# inspired from: https://stackoverflow.com/questions/10875442/possible-to-change-a-functions-repr-in-python
149152
class Repr(object):
150153
def __init__(self, name, func):
@@ -908,7 +911,9 @@ def lookup(encoding, macro=True):
908911
try:
909912
return CodecMacro(encoding)
910913
except LookupError:
911-
raise LookupError("unknown encoding: %s" % encoding)
914+
e = LookupError("unknown encoding: %s" % encoding)
915+
e.__cause__ = e # stop exception chaining
916+
raise e
912917
codecs.lookup = lookup
913918

914919

codext/crypto/affine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ def encmap_factory(mask=None):
2828
return encmap
2929

3030

31-
add_map("affine", encmap_factory, pattern=r"affine(?:[-_]cipher)?(?:[-_](.+?\-\d+\,\d+))?$")
31+
add_map("affine", encmap_factory, pattern=r"^affine(?:[-_]cipher)?(?:[-_](.+?\-\d+\,\d+))?$")
3232

0 commit comments

Comments
 (0)