Merge lp:~brian-murray/apturl/python3-port into lp:apturl
Proposed by
Brian Murray
Status: | Merged |
---|---|
Merged at revision: | 121 |
Proposed branch: | lp:~brian-murray/apturl/python3-port |
Merge into: | lp:apturl |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp:~brian-murray/apturl/python3-port |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Murray | Approve | ||
Barry Warsaw | Pending | ||
Review via email: mp+109730@code.launchpad.net |
Description of the change
python3 port
To post a comment you must log in.
On Jun 11, 2012, at 08:41 PM, Brian Murray wrote:
>Brian Murray has proposed merging lp:~brian-murray/apturl/python3-port into lp:apturl. /code.launchpad .net/~brian- murray/ apturl/ python3- port/+merge/ 109730
>
>Requested reviews:
> Barry Warsaw (barry)
>
>For more details, see:
>https:/
>
>python3 port
=== modified file 'AptUrl/Helpers.py' ngettext( singular, plural, n))
--- AptUrl/Helpers.py 2009-09-10 11:45:36 +0000
+++ AptUrl/Helpers.py 2012-06-11 20:40:26 +0000
> @@ -16,7 +16,7 @@
> # General Public License for more details.
> #
> # You should have received a copy of the GNU General Public License
> -# along with GDebi; if not, write to the Free Software
> +# along with AptUrl; if not, write to the Free Software
> # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
>
> import gettext
> @@ -29,13 +29,14 @@
> return utf8(gettext.
>
> def utf8(str):
> - if isinstance(str, unicode):
> + if isinstance(str, bytes):
Probably better:
if str is bytes:
which will be true in Python 2 but not in Python 3.
=== modified file 'AptUrl/Parser.py' 0:MAX_URL_ LEN/10]
--- AptUrl/Parser.py 2011-10-13 06:59:34 +0000
+++ AptUrl/Parser.py 2012-06-11 20:40:26 +0000
> @@ -105,7 +105,8 @@
> res = []
>
> if len(full_url) > MAX_URL_LEN:
> - url = "%s ..." % full_url[
You can also use the // operator to restore integer division. This works in
both versions of Python.
> + url_cutoff = int(MAX_URL_LEN / 10) 0:url_cutoff] tion(url, _("Url string '%s' too long") % url)
> + url = "%s ..." % full_url[
> raise InvalidUrlExcep
>
> # check against whitelist
=== modified file 'tests/ apturlparse. py' se.py 2011-10-13 06:59:34 +0000 se.py 2012-06-11 20:40:26 +0000 test_helpers. py' helpers. py 2009-01-08 19:46:00 +0000 helpers. py 2012-06-11 20:40:26 +0000 pkg(self) : "summary\ ndescr\ n") (parse_ pkg(pkgobj) == ('summary' ,'descr\ n',None) ) (parse_ pkg(pkgobj) == ('summary' ,'descr\ n',None) ) (parse_ pkg(pkgobj) == ('summary only','',None)) (parse_ pkg(pkgobj) == ('summary only','',None))
--- tests/apturlpar
+++ tests/apturlpar
=== modified file 'tests/
--- tests/test_
+++ tests/test_
> @@ -15,9 +15,9 @@
>
> def test_parse_
> pkgobj = MockPkg(
> - self.assert_
> + self.assertTrue
> pkgobj = MockPkg("summary only")
> - self.assert_
> + self.assertTrue
Why not change these to assertEqual() calls?
>
> if __name__ == "__main__":
> unittest.main()