anakin87 commited on
Commit
5f65095
1 Parent(s): 9abea4e

support streamlit 1.10-1.12

Browse files
Files changed (2) hide show
  1. Rock_fact_checker.py +5 -2
  2. data/statements.txt +1 -1
Rock_fact_checker.py CHANGED
@@ -59,8 +59,11 @@ def main():
59
  # Re-runs the script setting the random statement as the textbox value
60
  # Unfortunately necessary as the Random statement button is _below_ the textbox
61
  # Adapted for Streamlit>=1.12
62
- raise st.runtime.scriptrunner.script_runner.RerunException(
63
- st.runtime.scriptrunner.script_requests.RerunData("")
 
 
 
64
  )
65
  else:
66
  st.session_state.random_statement_requested = False
 
59
  # Re-runs the script setting the random statement as the textbox value
60
  # Unfortunately necessary as the Random statement button is _below_ the textbox
61
  # Adapted for Streamlit>=1.12
62
+ if hasattr(st, 'scriptrunner'):
63
+ raise st.scriptrunner.script_runner.RerunException(st.scriptrunner.script_requests.RerunData(None))
64
+ else:
65
+ raise st.runtime.scriptrunner.script_runner.RerunException(
66
+ st.runtime.scriptrunner.script_requests.RerunData("")
67
  )
68
  else:
69
  st.session_state.random_statement_requested = False
data/statements.txt CHANGED
@@ -45,4 +45,4 @@ The Cure made dark songs
45
  Cannibal Corpse is a pop punk band
46
  Slipknot wear masks
47
  Toto have sold many records
48
- The verve were a prominent English band
 
45
  Cannibal Corpse is a pop punk band
46
  Slipknot wear masks
47
  Toto have sold many records
48
+ The verve were a British band