Skip to content

Commit b5a1725

Browse files
committed
few adjustments
1 parent 5942bfe commit b5a1725

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/MathModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1996,7 +1996,7 @@ public abstract static class SumprodNode extends PythonBinaryBuiltinNode {
19961996
static boolean int_path(VirtualFrame frame, Node inliningTarget, Object p_i, Object q_i, long[] int_total,
19971997
PyLongCheckExactNode pyLongCheckExactNode,
19981998
PyLongAsLongAndOverflowNode pyLongAsLongAndOverflowNode) {
1999-
if (pyLongCheckExactNode.execute(inliningTarget, p_i) & pyLongCheckExactNode.execute(inliningTarget, q_i)) {
1999+
if (pyLongCheckExactNode.execute(inliningTarget, p_i) && pyLongCheckExactNode.execute(inliningTarget, q_i)) {
20002000
try {
20012001
long int_p = pyLongAsLongAndOverflowNode.execute(frame, inliningTarget, p_i);
20022002
long int_q = pyLongAsLongAndOverflowNode.execute(frame, inliningTarget, q_i);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PosixSubprocessModuleBuiltins.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,18 @@ private static boolean isBytecodeDSLJvmVenvLauncher(PythonContext context, byte[
330330
// best effort to find our if we are executing venv launcher
331331
Path executablePath = Path.of(context.getOption(PythonOptions.Executable).toJavaStringUncached()).toAbsolutePath();
332332
Path path = Path.of(new String(bytes));
333-
while (Files.isSymbolicLink(path)) {
333+
Path parent = path.getParent();
334+
while (Files.isSymbolicLink(path) && parent != null) {
334335
try {
335336
Path symlink = Files.readSymbolicLink(path);
336-
path = path.getParent().resolve(symlink).toAbsolutePath();
337+
path = parent.resolve(symlink).toAbsolutePath();
337338
} catch (IOException ignore) {
338339
return false;
339340
}
340341
if (path.equals(executablePath)) {
341342
return true;
342343
}
344+
parent = path.getParent();
343345
}
344346
return false;
345347
}

0 commit comments

Comments
 (0)