diff options
author | Stephen Altamirano <stephen@evilrobotstuff.com> | 2011-07-26 22:47:08 -0700 |
---|---|---|
committer | Stephen Altamirano <stephen@evilrobotstuff.com> | 2011-07-26 22:47:08 -0700 |
commit | 78049abac123332123990994b50a70bc789b7514 (patch) | |
tree | 51db18286a42ebe75392eecc3c71da6d69ccf67e /libmproxy/flow.py | |
parent | e6288e2d0751502eee1a44723a36230c12b821f3 (diff) | |
download | mitmproxy-78049abac123332123990994b50a70bc789b7514.tar.gz mitmproxy-78049abac123332123990994b50a70bc789b7514.tar.bz2 mitmproxy-78049abac123332123990994b50a70bc789b7514.zip |
Changes replace logic to function in both Python 2.6.x and 2.7.x
Tests now only assume Python 2.6.x rather than requiring 2.7.x. This does not preclude the use of flags as a kwarg in replace
Diffstat (limited to 'libmproxy/flow.py')
-rw-r--r-- | libmproxy/flow.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 3078c4e0..8267ff43 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -323,16 +323,16 @@ class Flow: self.response.ack() self.intercepting = False - def replace(self, pattern, repl, count=0, flags=0): + def replace(self, pattern, repl, *args, **kwargs): """ Replaces a regular expression pattern with repl in all parts of the - flow . Returns the number of replacements made. + flow . Returns the number of replacements made. """ - c = self.request.replace(pattern, repl, count, flags) + c = self.request.replace(pattern, repl, *args, **kwargs) if self.response: - c += self.response.replace(pattern, repl, count, flags) + c += self.response.replace(pattern, repl, *args, **kwargs) if self.error: - c += self.error.replace(pattern, repl, count, flags) + c += self.error.replace(pattern, repl, *args, **kwargs) return c |