From 806aa0f41c7816b2859a6961939ed19499b73fe7 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 2 Apr 2016 14:38:33 +0200 Subject: improve .replace() and move it into netlib --- netlib/odict.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'netlib/odict.py') 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): -- cgit v1.2.3