[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Consolidating how StreamClosureReason is made
commit 786624951b627ae76370ab3afe38997552b80ae2
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Sun Dec 9 14:23:42 2012 -0800
Consolidating how StreamClosureReason is made
---
stem/__init__.py | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/stem/__init__.py b/stem/__init__.py
index 092413b..9dd0cb5 100644
--- a/stem/__init__.py
+++ b/stem/__init__.py
@@ -574,16 +574,11 @@ StreamStatus = stem.util.enum.UppercaseEnum(
"CLOSED",
)
-# add STREAM event specific reasons to the list of RELAY_END reasons
-_tmp_StreamClosureReason = [v for v in RelayEndReason]
-_tmp_StreamClosureReason.extend((
+# StreamClosureReason is a superset of RelayEndReason
+StreamClosureReason = stem.util.enum.UppercaseEnum(*(RelayEndReason.keys() + (
"END",
"PRIVATE_ADDR",
-))
-# build UppercaseEnum from extended list
-StreamClosureReason = stem.util.enum.UppercaseEnum(*_tmp_StreamClosureReason)
-# remove temporary list
-del _tmp_StreamClosureReason
+)))
StreamSource = stem.util.enum.UppercaseEnum(
"CACHE",
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits