Skip to content

Commit c91612c

Browse files
Copilotyouknowone
andcommitted
Fix SemLock constant interning to avoid panic
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
1 parent aa11f3e commit c91612c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

crates/stdlib/src/multiprocessing.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,17 +339,15 @@ mod _multiprocessing {
339339
#[extend_class]
340340
fn extend_class(ctx: &Context, class: &Py<PyType>) {
341341
class.set_attr(
342-
ctx.interned_str("RECURSIVE_MUTEX")
343-
.expect("intern RECURSIVE_MUTEX"),
342+
ctx.intern_str("RECURSIVE_MUTEX"),
344343
ctx.new_int(RECURSIVE_MUTEX_KIND).into(),
345344
);
346345
class.set_attr(
347-
ctx.interned_str("SEMAPHORE").expect("intern SEMAPHORE"),
346+
ctx.intern_str("SEMAPHORE"),
348347
ctx.new_int(SEMAPHORE_KIND).into(),
349348
);
350349
class.set_attr(
351-
ctx.interned_str("SEM_VALUE_MAX")
352-
.expect("intern SEM_VALUE_MAX"),
350+
ctx.intern_str("SEM_VALUE_MAX"),
353351
ctx.new_int(SEM_VALUE_MAX_CONST).into(),
354352
);
355353
}

0 commit comments

Comments
 (0)