diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-04-03 08:17:30 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-04-03 08:17:30 -0700 |
commit | 0259f479974f4f61e28bf1dac0d0f5229e468c36 (patch) | |
tree | 7bf64d328bf6dcbe12d4e8f4b6cba20125b3bf34 /netlib/odict.py | |
parent | 84f650aabf739f40b3ff414c646257141babd6e1 (diff) | |
parent | 806aa0f41c7816b2859a6961939ed19499b73fe7 (diff) | |
download | mitmproxy-0259f479974f4f61e28bf1dac0d0f5229e468c36.tar.gz mitmproxy-0259f479974f4f61e28bf1dac0d0f5229e468c36.tar.bz2 mitmproxy-0259f479974f4f61e28bf1dac0d0f5229e468c36.zip |
Merge branch 'better-replace'
Diffstat (limited to 'netlib/odict.py')
-rw-r--r-- | netlib/odict.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/netlib/odict.py b/netlib/odict.py index 1e6e381a..461192f7 100644 --- a/netlib/odict.py +++ b/netlib/odict.py @@ -1,18 +1,8 @@ from __future__ import (absolute_import, print_function, division) -import re import copy import six -from .utils import Serializable - - -def safe_subn(pattern, repl, target, *args, **kwargs): - """ - There are Unicode conversion problems with re.subn. We try to smooth - that over by casting the pattern and replacement to strings. We really - need a better solution that is aware of the actual content ecoding. - """ - return re.subn(str(pattern), str(repl), target, *args, **kwargs) +from .utils import Serializable, safe_subn class ODict(Serializable): |