mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
Merge pull request #1644 from RustPython/coolreader18/exc-cleanup
Use PyBaseExceptionRef in places where we expect exceptions
This commit is contained in:
@@ -7,6 +7,7 @@ use super::objbytes;
|
||||
use super::objint::{self, PyInt, PyIntRef};
|
||||
use super::objstr::{PyString, PyStringRef};
|
||||
use super::objtype::{self, PyClassRef};
|
||||
use crate::exceptions::PyBaseExceptionRef;
|
||||
use crate::function::{OptionalArg, OptionalOption};
|
||||
use crate::pyhash;
|
||||
use crate::pyobject::{
|
||||
@@ -619,7 +620,7 @@ fn str_to_float(vm: &VirtualMachine, literal: &str) -> PyResult<f64> {
|
||||
}
|
||||
}
|
||||
|
||||
fn invalid_convert(vm: &VirtualMachine, literal: &str) -> PyObjectRef {
|
||||
fn invalid_convert(vm: &VirtualMachine, literal: &str) -> PyBaseExceptionRef {
|
||||
vm.new_value_error(format!("could not convert string to float: '{}'", literal))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user