Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Allows unicode characters (eg. Japanese) in the python files that are run in the simulator #243

Merged
merged 1 commit into from
Mar 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/debug_user_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
mb._MicrobitModel__set_debug_mode(True)

# Execute the user's code file
with open(abs_path_to_code_file) as user_code_file:
with open(abs_path_to_code_file, encoding="utf8") as user_code_file:
user_code = user_code_file.read()
try:
codeObj = compile(user_code, abs_path_to_code_file, CONSTANTS.EXEC_COMMAND)
Expand Down
2 changes: 1 addition & 1 deletion src/process_user_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def handle_user_prints():
def execute_user_code(abs_path_to_code_file):
cpx._Express__abs_path_to_code_file = abs_path_to_code_file
# Execute the user's code.py file
with open(abs_path_to_code_file) as user_code_file:
with open(abs_path_to_code_file, encoding="utf8") as user_code_file:
user_code = user_code_file.read()
try:
codeObj = compile(user_code, abs_path_to_code_file, CONSTANTS.EXEC_COMMAND)
Expand Down