##// END OF EJS Templates
debuginstall: gracefully handle missing __file__ attributes...
Matt Harbison -
r44083:1fb19665 default
parent child Browse files
Show More
@@ -1470,6 +1470,12 b' def debuginstall(ui, **opts):'
1470 1470 )
1471 1471
1472 1472 # Python
1473 pythonlib = None
1474 if util.safehasattr(os, '__file__'):
1475 pythonlib = os.path.dirname(pycompat.fsencode(os.__file__))
1476 elif getattr(sys, 'oxidized', False):
1477 pythonlib = pycompat.sysexecutable
1478
1473 1479 fm.write(
1474 1480 b'pythonexe',
1475 1481 _(b"checking Python executable (%s)\n"),
@@ -1483,7 +1489,7 b' def debuginstall(ui, **opts):'
1483 1489 fm.write(
1484 1490 b'pythonlib',
1485 1491 _(b"checking Python lib (%s)...\n"),
1486 os.path.dirname(pycompat.fsencode(os.__file__)),
1492 pythonlib or _(b"unknown"),
1487 1493 )
1488 1494
1489 1495 security = set(sslutil.supportedprotocols)
@@ -1527,13 +1533,19 b' def debuginstall(ui, **opts):'
1527 1533 )
1528 1534
1529 1535 # compiled modules
1536 hgmodules = None
1537 if util.safehasattr(sys.modules[__name__], '__file__'):
1538 hgmodules = os.path.dirname(pycompat.fsencode(__file__))
1539 elif getattr(sys, 'oxidized', False):
1540 hgmodules = pycompat.sysexecutable
1541
1530 1542 fm.write(
1531 1543 b'hgmodulepolicy', _(b"checking module policy (%s)\n"), policy.policy
1532 1544 )
1533 1545 fm.write(
1534 1546 b'hgmodules',
1535 1547 _(b"checking installed modules (%s)...\n"),
1536 os.path.dirname(pycompat.fsencode(__file__)),
1548 hgmodules or _(b"unknown"),
1537 1549 )
1538 1550
1539 1551 rustandc = policy.policy in (b'rust+c', b'rust+c-allow')
General Comments 0
You need to be logged in to leave comments. Login now