Submitter | Pulkit Goyal |
---|---|
Date | Aug. 9, 2016, 11:06 p.m. |
Message ID | <9a344ce563ce2221bdfc.1470784003@waste.org> |
Download | mbox | patch |
Permalink | /patch/16233/ |
State | Not Applicable |
Headers | show |
Comments
At Tue, 09 Aug 2016 18:06:43 -0500, Pulkit Goyal wrote: > > # HG changeset patch > # User Pulkit Goyal <7895pulkit@gmail.com> > # Date 1470680471 -19800 > # Mon Aug 08 23:51:11 2016 +0530 > # Node ID 9a344ce563ce2221bdfc9031b8f249d9da2f08b0 > # Parent 37b6f0ec6241a62de90737409458cd622e2fac0d > py3: conditionalize the raise statement (snip) > diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t > --- a/tests/test-check-py3-compat.t > +++ b/tests/test-check-py3-compat.t (snip) > @@ -136,13 +136,13 @@ > mercurial/patch.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob) > mercurial/pathutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob) > mercurial/peer.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob) > - mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'pycompat' (line *) (glob) > + mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'policy' (line *) (glob) This change for mercurial/pure/mpatch.py doesn't related to fixing up in this patch. This is already fixed by my previous patch below: https://www.mercurial-scm.org/repo/hg-committed/rev/297a0dc50320 > mercurial/pure/osutil.py: error importing module: <ImportError> cannot import name 'policy' (line *) (glob) > mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'mercurial.pure.node' (line *) (glob) > mercurial/pushkey.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob) > mercurial/pvec.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob) > mercurial/registrar.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob) > - mercurial/repair.py: error importing module: <SyntaxError> invalid syntax (bundle2.py, line *) (line *) (glob) > + mercurial/repair.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob) > mercurial/repoview.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob) > mercurial/revlog.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob) > mercurial/revset.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob) > @@ -169,6 +169,6 @@ > mercurial/verify.py: error importing: <TypeError> attribute name must be string, not 'bytes' (error at mdiff.py:*) (glob) > mercurial/win32.py: error importing module: <ImportError> No module named 'msvcrt' (line *) (glob) > mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob) > - mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle2.py, line *) (line *) (glob) > + mercurial/wireproto.py: error importing module: <TypeError> a bytes-like object is required, not 'str' (line *) (glob) > > #endif > _______________________________________________ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel ---------------------------------------------------------------------- [FUJIWARA Katsunori] foozy@lares.dti.ne.jp
> This change for mercurial/pure/mpatch.py doesn't related to fixing up > in this patch. This is already fixed by my previous patch below: Yeah thats why I have mentioned in the commit message that this patch also contains an update to test-check-py3-compat.t . I saw your patch being pushed, if people are happy to push my patch, I will send an updated version.
On Tue, 09 Aug 2016 18:06:43 -0500, Pulkit Goyal wrote: > # HG changeset patch > # User Pulkit Goyal <7895pulkit@gmail.com> > # Date 1470680471 -19800 > # Mon Aug 08 23:51:11 2016 +0530 > # Node ID 9a344ce563ce2221bdfc9031b8f249d9da2f08b0 > # Parent 37b6f0ec6241a62de90737409458cd622e2fac0d > py3: conditionalize the raise statement Queued the series, thanks. I've updated test conflicts in flight.
Patch
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -989,7 +989,10 @@ outdebug(ui, 'closing payload chunk') # abort current part payload yield _pack(_fpayloadsize, 0) - raise exc_info[0], exc_info[1], exc_info[2] + if sys.version_info[0] >= 3: + raise exc_info[0](exc_info[1]).with_traceback(exc_info[2]) + else: + exec("""raise exc_info[0], exc_info[1], exc_info[2]""") # end of payload outdebug(ui, 'closing payload chunk') yield _pack(_fpayloadsize, 0) diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t +++ b/tests/test-check-py3-compat.t @@ -81,7 +81,7 @@ mercurial/archival.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) mercurial/bookmarks.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob) mercurial/branchmap.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob) - mercurial/bundle2.py: invalid syntax: invalid syntax (<unknown>, line *) (glob) + mercurial/bundle2.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob) mercurial/bundlerepo.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob) mercurial/byterange.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob) mercurial/changegroup.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob) @@ -136,13 +136,13 @@ mercurial/patch.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob) mercurial/pathutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob) mercurial/peer.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob) - mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'pycompat' (line *) (glob) + mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'policy' (line *) (glob) mercurial/pure/osutil.py: error importing module: <ImportError> cannot import name 'policy' (line *) (glob) mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'mercurial.pure.node' (line *) (glob) mercurial/pushkey.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob) mercurial/pvec.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob) mercurial/registrar.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob) - mercurial/repair.py: error importing module: <SyntaxError> invalid syntax (bundle2.py, line *) (line *) (glob) + mercurial/repair.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob) mercurial/repoview.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob) mercurial/revlog.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob) mercurial/revset.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob) @@ -169,6 +169,6 @@ mercurial/verify.py: error importing: <TypeError> attribute name must be string, not 'bytes' (error at mdiff.py:*) (glob) mercurial/win32.py: error importing module: <ImportError> No module named 'msvcrt' (line *) (glob) mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob) - mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle2.py, line *) (line *) (glob) + mercurial/wireproto.py: error importing module: <TypeError> a bytes-like object is required, not 'str' (line *) (glob) #endif