Skip to content

Commit f2db23b

Browse files
author
idbentley
committed
correct order of errors.
1 parent 19557e8 commit f2db23b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

vm/src/exceptions.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ impl ExceptionZoo {
113113

114114
let exception_type = create_type("Exception", &type_type, &base_exception_type, &dict_type);
115115

116-
let runtime_error = create_type("RuntimeError", &type_type, &exception_type, &dict_type);
117-
let import_error = create_type("ImportError", &type_type, &exception_type, &dict_type);
118-
119116
let assertion_error =
120117
create_type("AssertionError", &type_type, &exception_type, &dict_type);
121118
let attribute_error = create_type(
@@ -124,18 +121,25 @@ impl ExceptionZoo {
124121
&exception_type.clone(),
125122
&dict_type,
126123
);
127-
let file_not_found_error =
128-
create_type("FileNotFoundError", &type_type, &import_error, &dict_type);
124+
let import_error = create_type("ImportError", &type_type, &exception_type, &dict_type);
129125
let index_error = create_type(
130126
"IndexError",
131127
&type_type,
132128
&exception_type.clone(),
133129
&dict_type,
134130
);
135131
let key_error = create_type("KeyError", &type_type, &exception_type.clone(), &dict_type);
132+
let name_error = create_type("NameError", &type_type, &exception_type.clone(), &dict_type);
133+
let runtime_error = create_type("RuntimeError", &type_type, &exception_type, &dict_type);
134+
let stop_iteration = create_type("StopIteration", &type_type, &exception_type, &dict_type);
135+
let syntax_error = create_type("SyntaxError", &type_type, &exception_type, &dict_type);
136+
let type_error = create_type("TypeError", &type_type, &exception_type, &dict_type);
137+
let value_error = create_type("ValueError", &type_type, &exception_type, &dict_type);
138+
139+
let file_not_found_error =
140+
create_type("FileNotFoundError", &type_type, &import_error, &dict_type);
136141
let module_not_found_error =
137142
create_type("ModuleNotFoundError", &type_type, &import_error, &dict_type);
138-
let name_error = create_type("NameError", &type_type, &exception_type.clone(), &dict_type);
139143
let not_implemented_error = create_type(
140144
"NotImplementedError",
141145
&type_type,
@@ -144,14 +148,10 @@ impl ExceptionZoo {
144148
);
145149
let permission_error =
146150
create_type("PermissionError", &type_type, &import_error, &dict_type);
147-
let stop_iteration = create_type("StopIteration", &type_type, &exception_type, &dict_type);
148-
let syntax_error = create_type("SyntaxError", &type_type, &exception_type, &dict_type);
149-
let type_error = create_type("TypeError", &type_type, &exception_type, &dict_type);
150-
let value_error = create_type("ValueError", &type_type, &exception_type, &dict_type);
151151

152152
ExceptionZoo {
153-
attribute_error: attribute_error,
154153
assertion_error: assertion_error,
154+
attribute_error: attribute_error,
155155
base_exception_type: base_exception_type,
156156
exception_type: exception_type,
157157
file_not_found_error: file_not_found_error,

0 commit comments

Comments
 (0)