summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2015-06-17 22:52:56 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2015-06-17 22:55:41 +0200
commit60960e05e9a6eee89e5137daed5884f423e6af24 (patch)
tree07bc5d777f774b2382f4824177d2a54bb22f3b67
parentde2f8593907a41d81dc9951a8adae118b404399a (diff)
Remove env. variables in a neater way.
-rw-r--r--testsuite.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/testsuite.py b/testsuite.py
index 2fc7885..0fb9992 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -432,10 +432,8 @@ def run_selftests():
def verify_print(o, s):
verify_equals(str(o), textwrap.dedent(s[1:]))
- try:
- del os.environ["ARCH"], os.environ["SRCARCH"], os.environ["srctree"]
- except:
- pass
+ for var in ("ARCH", "SRCARCH", "srctree"):
+ os.environ.pop(var, None)
# The tests below aren't meant to imply that the format is set in stone.
# It's just to verify that the strings do not change unexpectedly.