Patchwork D7939: py3: glob over exception in test-check-py3-compat.t

login
register
mail settings
Submitter phabricator
Date Jan. 18, 2020, 7:42 a.m.
Message ID <differential-rev-PHID-DREV-m2u6lfxk3xqt7jgyccwo-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44515/
State Superseded
Headers show

Comments

phabricator - Jan. 18, 2020, 7:42 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Python 3.6+ raise ModuleNotFoundError and older versions raise
  ImportError. Glob over the exception differences.
  
  For whatever reason, we were already doing this for one failure.
  But not all occurrences of ModuleNotFoundError were changed.
  Who knows.
  
  This test should now pass on all Python versions (although I didn't
  check Windows).

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D7939

AFFECTED FILES
  tests/test-check-py3-compat.t

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

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
@@ -41,9 +41,9 @@ 
   hgext/infinitepush/sqlindexapi.py: error importing: <*Error> No module named 'mysql' (error at sqlindexapi.py:*) (glob) (?)
   mercurial/scmwindows.py: error importing: <ValueError> _type_ 'v' not supported (error at win32.py:*) (no-windows !)
   mercurial/win32.py: error importing: <ValueError> _type_ 'v' not supported (error at win32.py:*) (no-windows !)
-  mercurial/windows.py: error importing: <ModuleNotFoundError> No module named 'msvcrt' (error at windows.py:*) (no-windows !)
-  mercurial/posix.py: error importing: <ModuleNotFoundError> No module named 'fcntl' (error at posix.py:*) (windows !)
-  mercurial/scmposix.py: error importing: <ModuleNotFoundError> No module named 'fcntl' (error at scmposix.py:*) (windows !)
+  mercurial/windows.py: error importing: <*Error> No module named 'msvcrt' (error at windows.py:*) (glob) (no-windows !)
+  mercurial/posix.py: error importing: <*Error> No module named 'fcntl' (error at posix.py:*) (glob) (windows !)
+  mercurial/scmposix.py: error importing: <*Error> No module named 'fcntl' (error at scmposix.py:*) (glob) (windows !)
 #endif
 
 #if py3 pygments