cahya commited on
Commit
8933d2a
1 Parent(s): 6802f3f

fixed get_script_run_ctx

Browse files
Files changed (1) hide show
  1. app/SessionState.py +3 -8
app/SessionState.py CHANGED
@@ -15,13 +15,8 @@ result:
15
  >>> session_state.user_name
16
  'Mary'
17
  """
18
- try:
19
- import streamlit.ReportThread as ReportThread
20
- from streamlit.server.Server import Server
21
- except Exception:
22
- # Streamlit >= 0.65.0
23
- import streamlit.report_thread as ReportThread
24
- from streamlit.server.server import Server
25
 
26
 
27
  class SessionState(object):
@@ -67,7 +62,7 @@ def get(**kwargs):
67
  """
68
  # Hack to get the session object from Streamlit.
69
 
70
- ctx = ReportThread.get_report_ctx()
71
 
72
  this_session = None
73
 
 
15
  >>> session_state.user_name
16
  'Mary'
17
  """
18
+ from streamlit.script_run_context import get_script_run_ctx
19
+ from streamlit.server.Server import Server
 
 
 
 
 
20
 
21
 
22
  class SessionState(object):
 
62
  """
63
  # Hack to get the session object from Streamlit.
64
 
65
+ ctx = get_script_run_ctx()
66
 
67
  this_session = None
68