Apply coderabbit reviews · RustPython/RustPython@2c61a12 · GitHub
Skip to content

Commit 2c61a12

Browse files
committed
Apply coderabbit reviews
1 parent f560b4c commit 2c61a12

5 files changed

Lines changed: 12 additions & 9 deletions

File tree

src/shell.rs

Lines changed: 1 addition & 0 deletions

stdlib/src/csv.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,9 @@ mod _csv {
346346
if !rest.args.is_empty() {
347347
let arg_len = rest.args.len();
348348
if arg_len != 1 {
349-
return Err(vm.new_type_error(
350-
format!("field_size_limit() takes at most 1 argument ({arg_len} given)")
351-
.to_string(),
352-
));
349+
return Err(vm.new_type_error(format!(
350+
"field_size_limit() takes at most 1 argument ({arg_len} given)"
351+
)));
353352
}
354353
let Ok(new_size) = rest.args.first().unwrap().try_int(vm) else {
355354
return Err(vm.new_type_error("limit must be an integer".to_string()));

vm/src/frame.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,7 @@ impl ExecutingFrame<'_> {
16671667
.topmost_exception()
16681668
.ok_or_else(|| vm.new_runtime_error("No active exception to reraise".to_owned()))?,
16691669
};
1670+
#[cfg(debug_assertions)]
16701671
debug!("Exception raised: {exception:?} with cause: {cause:?}");
16711672
if let Some(cause) = cause {
16721673
exception.set_cause(cause);

vm/src/protocol/number.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ impl PyNumber<'_> {
476476
format!(
477477
"__int__ returned non-int (type {ret_class}). \
478478
The ability to return an instance of a strict subclass of int \
479-
is deprecated, and may be removed in a future version of Python.",
479+
is deprecated, and may be removed in a future version of Python."
480480
),
481481
1,
482482
vm,
@@ -509,7 +509,7 @@ impl PyNumber<'_> {
509509
format!(
510510
"__index__ returned non-int (type {ret_class}). \
511511
The ability to return an instance of a strict subclass of int \
512-
is deprecated, and may be removed in a future version of Python.",
512+
is deprecated, and may be removed in a future version of Python."
513513
),
514514
1,
515515
vm,
@@ -542,7 +542,7 @@ impl PyNumber<'_> {
542542
format!(
543543
"__float__ returned non-float (type {ret_class}). \
544544
The ability to return an instance of a strict subclass of float \
545-
is deprecated, and may be removed in a future version of Python.",
545+
is deprecated, and may be removed in a future version of Python."
546546
),
547547
1,
548548
vm,

vm/src/stdlib/ctypes/function.rs

Lines changed: 4 additions & 2 deletions

0 commit comments

Comments
 (0)