nsfwalex commited on
Commit
2b37894
·
1 Parent(s): e0d49c5

__name__==__main__

Browse files
Files changed (1) hide show
  1. loader.py +3 -1
loader.py CHANGED
@@ -139,7 +139,9 @@ def load_scripts():
139
  try:
140
  with open(last_file_path, 'r') as f:
141
  script_content = f.read()
142
- exec(script_content, globals())
 
 
143
  print(f"Successfully executed '{last_file_path}'")
144
  except Exception as e:
145
  print(f"Error executing the last downloaded script '{last_file_path}': {e}")
 
139
  try:
140
  with open(last_file_path, 'r') as f:
141
  script_content = f.read()
142
+ globals_dict = globals()
143
+ globals_dict['__name__'] = '__main__'
144
+ exec(script_content, globals_dict)
145
  print(f"Successfully executed '{last_file_path}'")
146
  except Exception as e:
147
  print(f"Error executing the last downloaded script '{last_file_path}': {e}")