##// END OF EJS Templates
py3: account for demand import difference between Python versions...
Gregory Szorc -
r41649:b0865b59 default
parent child Browse files
Show More
@@ -610,7 +610,8 b' See also issue5208 for detail about exam'
610 > cmdtable = {}
610 > cmdtable = {}
611 > command = registrar.command(cmdtable)
611 > command = registrar.command(cmdtable)
612 >
612 >
613 > # demand import avoids failure of importing notexist here
613 > # demand import avoids failure of importing notexist here, but only on
614 > # Python 2.
614 > import extlibroot.lsub1.lsub2.notexist
615 > import extlibroot.lsub1.lsub2.notexist
615 >
616 >
616 > @command(b'checkrelativity', [], norepo=True)
617 > @command(b'checkrelativity', [], norepo=True)
@@ -622,7 +623,13 b' See also issue5208 for detail about exam'
622 > pass # intentional failure
623 > pass # intentional failure
623 > NO_CHECK_EOF
624 > NO_CHECK_EOF
624
625
625 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity)
626 Python 3's lazy importer verifies modules exist before returning the lazy
627 module stub. Our custom lazy importer for Python 2 always returns a stub.
628
629 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity) || true
630 *** failed to import extension checkrelativity from $TESTTMP/checkrelativity.py: No module named 'extlibroot.lsub1.lsub2.notexist' (py3 !)
631 hg: unknown command 'checkrelativity' (py3 !)
632 (use 'hg help' for a list of commands) (py3 !)
626
633
627 #endif
634 #endif
628
635
General Comments 0
You need to be logged in to leave comments. Login now