anubhav77 commited on
Commit
6ba99b2
·
1 Parent(s): cc58ab6
Files changed (1) hide show
  1. main.py +5 -1
main.py CHANGED
@@ -137,7 +137,11 @@ def raw_sql(raw_sql: RawSql):
137
  @app.post(api_base+"/walk")
138
  def walk(path: PathRequest):
139
  print("Received walk request")
140
- (root,items,files) =os.walk(path.dir)
 
 
 
 
141
  response= JSONResponse(content= {"dirs":[]})
142
  for item in items:
143
  print(item)
 
137
  @app.post(api_base+"/walk")
138
  def walk(path: PathRequest):
139
  print("Received walk request")
140
+ try:
141
+ (root,items,files) =os.walk(path.dir,topdown=True)
142
+ except Exception:
143
+ print("got exception")
144
+ items=os.walk(path.dir)
145
  response= JSONResponse(content= {"dirs":[]})
146
  for item in items:
147
  print(item)