File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -88,3 +88,4 @@ The following is a list of people who have contributed to
88
88
- Terence Honles (terencehonles)
89
89
- Paul Fisher (thetorpedodog)
90
90
- Julius Park (juliusgeo)
91
+ - Ishmum Jawad Khan (ishmum123)
Original file line number Diff line number Diff line change @@ -827,6 +827,9 @@ def _start_retryable_write(self):
827
827
self ._check_ended ()
828
828
self ._server_session .inc_transaction_id ()
829
829
830
+ def __copy__ (self ):
831
+ raise TypeError ('A ClientSession cannot be copied, create a new session instead' )
832
+
830
833
831
834
class _ServerSession (object ):
832
835
def __init__ (self , generation ):
Original file line number Diff line number Diff line change @@ -779,6 +779,11 @@ def drop_db():
779
779
780
780
wait_until (drop_db , 'dropped database after w=0 writes' )
781
781
782
+ def test_session_not_copyable (self ):
783
+ client = self .client
784
+ with client .start_session () as s :
785
+ self .assertRaises (TypeError , lambda : copy .copy (s ))
786
+
782
787
783
788
class TestCausalConsistency (unittest .TestCase ):
784
789
You can’t perform that action at this time.
0 commit comments