a0ms1n commited on
Commit
de7419c
·
1 Parent(s): 5198b48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -5,9 +5,14 @@ import re
5
 
6
  def load_cpp_file(file):
7
  text = file.name
8
- with open(text, 'r', encoding='utf-8') as f:
9
- content = f.read()
10
- return content
 
 
 
 
 
11
 
12
  def Evaluate_Code(code, method):
13
  if method == "No Format":
 
5
 
6
  def load_cpp_file(file):
7
  text = file.name
8
+ if file is None:
9
+ return ""
10
+ try:
11
+ with open(text, 'r', encoding='utf-8') as f:
12
+ content = f.read()
13
+ return content
14
+ except:
15
+ return ""
16
 
17
  def Evaluate_Code(code, method):
18
  if method == "No Format":