From c2ceac093f356166ef0d1bb1fd4be8c28c8b263e Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 31 Mar 2013 00:02:53 +0400 Subject: [PATCH] Add replace_item with function, remove os import --- tests/lib/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/lib/__init__.py b/tests/lib/__init__.py index fd99c4ab..85f196fd 100644 --- a/tests/lib/__init__.py +++ b/tests/lib/__init__.py @@ -1,7 +1,6 @@ # vim:fileencoding=utf-8:noet import imp import sys -import os class Pl(object): @@ -125,6 +124,10 @@ class ItemReplace(object): self.d[self.key] = self.old +def replace_item(d, key, new): + return ItemReplace(d, key, new, d) + + def replace_env(key, new, environ=None, **kwargs): r = kwargs.copy() r['environ'] = environ or {}