diff options
author | W. Trevor King <wking@tremily.us> | 2014-02-10 10:40:30 -0800 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2014-02-10 22:49:26 -0400 |
commit | 7b7a83cc32c90bc581256ea677d839adc85f1640 (patch) | |
tree | ab2911fcb42c1f2e8874a621ff1d5471d51dc503 /devel | |
parent | a6ff03df3f8fece526536f44a22af2041db021ef (diff) |
nmbug-status: Add a Python-3-compatible urllib.parse.quote import
Python 2's urllib.quote [1] has moved to urllib.parse.quote in Python
3 [2].
[1]: http://docs.python.org/2/library/urllib.html#urllib.quote
[2]: http://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote
Diffstat (limited to 'devel')
-rwxr-xr-x | devel/nmbug/nmbug-status | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index 3aa83b62..22b6b104 100755 --- a/devel/nmbug/nmbug-status +++ b/devel/nmbug/nmbug-status @@ -12,7 +12,10 @@ import codecs import datetime import email.utils import locale -import urllib +try: # Python 3 + from urllib.parse import quote +except ImportError: # Python 2 + from urllib import quote import json import argparse import os @@ -124,8 +127,8 @@ def print_view(database, title, query, comment, if output_format == 'html': - out['subject'] = '<a href="http://mid.gmane.org/%s">%s</a>' \ - % (urllib.quote(mid), out['subject']) + out['subject'] = '<a href="http://mid.gmane.org/%s">%s</a>' % ( + quote(mid), out['subject']) lines.append(' <tr><td>%s' % out['date']) lines.append('</td><td>%s' % out['id']) |