File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -239,7 +239,11 @@ impl Node for ast::Constant {
239
239
}
240
240
builtins:: singletons:: PyNone => ast:: Constant :: None ,
241
241
builtins:: slice:: PyEllipsis => ast:: Constant :: Ellipsis ,
242
- _ => return Err ( vm. new_type_error( "unsupported type for constant" . to_owned( ) ) ) ,
242
+ obj =>
243
+ return Err ( vm. new_type_error( format!(
244
+ "invalid type in Constant: type '{}'" ,
245
+ obj. class( ) . name( )
246
+ ) ) ) ,
243
247
} ) ;
244
248
Ok ( constant)
245
249
}
Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ mod builtins {
109
109
dont_inherit : OptionalArg < bool > ,
110
110
#[ pyarg( any, optional) ]
111
111
optimize : OptionalArg < PyIntRef > ,
112
+ #[ pyarg( any, optional) ]
113
+ _feature_version : OptionalArg < i32 > ,
112
114
}
113
115
114
116
#[ cfg( feature = "rustpython-compiler" ) ]
@@ -122,6 +124,10 @@ mod builtins {
122
124
{
123
125
use crate :: { class:: PyClassImpl , stdlib:: ast} ;
124
126
127
+ if args. _feature_version . is_present ( ) {
128
+ eprintln ! ( "TODO: compile() got `_feature_version` but ignored" ) ;
129
+ }
130
+
125
131
let mode_str = args. mode . as_str ( ) ;
126
132
127
133
if args
You can’t perform that action at this time.
0 commit comments