rust/hg-cpython/src/exceptions.rs
changeset 42609 326fdce22fb2
parent 42557 d26e4a434fe5
child 42752 30320c7bf79f
--- a/rust/hg-cpython/src/exceptions.rs	Fri Jul 12 11:08:31 2019 +0200
+++ b/rust/hg-cpython/src/exceptions.rs	Tue Jul 02 17:15:03 2019 +0200
@@ -12,8 +12,10 @@
 //! existing Python exceptions if appropriate.
 //!
 //! [`GraphError`]: struct.GraphError.html
-use cpython::exc::{RuntimeError, ValueError};
-use cpython::{exc, PyErr, Python};
+use cpython::{
+    exc::{IOError, RuntimeError, ValueError},
+    py_exception, PyErr, Python,
+};
 use hg;
 
 py_exception!(rustext, GraphError, ValueError);
@@ -55,7 +57,7 @@
         match inner {
             hg::PatternFileError::IO(e) => {
                 let value = (e.raw_os_error().unwrap_or(2), e.to_string());
-                PyErr::new::<exc::IOError, _>(py, value)
+                PyErr::new::<IOError, _>(py, value)
             }
             hg::PatternFileError::Pattern(e, l) => match e {
                 hg::PatternError::UnsupportedSyntax(m) => {