summaryrefslogtreecommitdiff
path: root/Mailman/bin/change_pw.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-09-19 07:28:58 -0400
committerBarry Warsaw2007-09-19 07:28:58 -0400
commit4c517789fa8b29d2a23791e6f390d9f1173c3125 (patch)
tree9b5c1ed27416cbec12665a1cea5206336d72c039 /Mailman/bin/change_pw.py
parent39c87b16da60a5274bfc7494d0a121b3162b56fb (diff)
downloadmailman-4c517789fa8b29d2a23791e6f390d9f1173c3125.tar.gz
mailman-4c517789fa8b29d2a23791e6f390d9f1173c3125.tar.zst
mailman-4c517789fa8b29d2a23791e6f390d9f1173c3125.zip
Diffstat (limited to 'Mailman/bin/change_pw.py')
-rw-r--r--Mailman/bin/change_pw.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Mailman/bin/change_pw.py b/Mailman/bin/change_pw.py
index 3830b76ae..9c89ef5cd 100644
--- a/Mailman/bin/change_pw.py
+++ b/Mailman/bin/change_pw.py
@@ -15,6 +15,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
+from __future__ import with_statement
+
import sha
import sys
import optparse
@@ -150,9 +152,7 @@ def main():
# Notification
print _('New $listname password: $notifypassword')
if not opts.quiet:
- otrans = i18n.get_translation()
- i18n.set_language(mlist.preferred_language)
- try:
+ with i18n.using_language(mlist.preferred_language):
hostname = mlist.host_name
adminurl = mlist.GetScriptURL('admin', absolute=True)
msg = Message.UserNotification(
@@ -171,8 +171,6 @@ liking. Visit your list admin page at
$adminurl
'''),
mlist.preferred_language)
- finally:
- i18n.set_translation(otrans)
msg.send(mlist)