Skip to content

Commit 6359940

Browse files
committed
Sonarqube: Either re-interrupt this method or rethrow the "InterruptedException"
1 parent 9db47d6 commit 6359940

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ Object sleep(long seconds) {
232232
try {
233233
Thread.sleep(seconds * 1000);
234234
} catch (InterruptedException ignored) {
235+
Thread.currentThread().interrupt();
235236
}
236237

237238
secs = deadline - (long) timeSeconds();
@@ -257,6 +258,7 @@ Object sleep(double seconds) {
257258
try {
258259
Thread.sleep(millis, nanos);
259260
} catch (InterruptedException ignored) {
261+
Thread.currentThread().interrupt();
260262
}
261263
secs = deadline - timeSeconds();
262264
if (secs < 0) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public void postInitialize(PythonCore core) {
114114
try {
115115
reference = weakRefQueue.remove();
116116
} catch (InterruptedException e) {
117+
Thread.currentThread().interrupt();
117118
}
118119
if (reference instanceof PReferenceType.WeakRefStorage) {
119120
return new WeakrefCallbackAction((PReferenceType.WeakRefStorage) reference);

0 commit comments

Comments
 (0)