This repository was archived by the owner on Dec 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-15
lines changed
micropython/microbit/__model Expand file tree Collapse file tree 2 files changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,7 @@ def escape_if_OSX(file_name):
52
52
return file_name
53
53
54
54
55
- def print_for_unimplemented_functions (function_name , one_more_call = False ):
56
- # Frame 0 is this function call
57
- # Frame 1 is the call that calls this function, which is a microbit function
58
- # Frame 2 is the call that calls the microbit function, which is in the user's file
59
- # If one_more_call is True, then there is another frame between what was originally supposed to be frame 1 and 2.
60
- frame_no = 2 if not one_more_call else 3
61
- line_number = sys ._getframe (frame_no ).f_lineno
62
- user_file_name = sys ._getframe (frame_no ).f_code .co_filename
55
+ def print_for_unimplemented_functions (function_name ):
63
56
print (
64
- f"'{ function_name } ' on line { line_number } in { user_file_name } is not implemented in the simulator but it will work on the actual device!"
57
+ f"'{ function_name } ' is not implemented in the simulator but it will work on the actual device!"
65
58
)
Original file line number Diff line number Diff line change @@ -30,15 +30,11 @@ def __init__(self):
30
30
31
31
def panic (self , n ):
32
32
# Due to the shim, there is another call frame.
33
- utils .print_for_unimplemented_functions (
34
- MicrobitModel .panic .__name__ , one_more_call = True
35
- )
33
+ utils .print_for_unimplemented_functions (MicrobitModel .panic .__name__ )
36
34
37
35
def reset (self ):
38
36
# Due to the shim, there is another call frame.
39
- utils .print_for_unimplemented_functions (
40
- MicrobitModel .reset .__name__ , one_more_call = True
41
- )
37
+ utils .print_for_unimplemented_functions (MicrobitModel .reset .__name__ )
42
38
43
39
def sleep (self , n ):
44
40
time .sleep (n / 1000 )
You can’t perform that action at this time.
0 commit comments