@@ -32,8 +32,11 @@ def close(self):
32
32
# HACK: dig through the sseclient library to the requests library down to the underlying socket.
33
33
# then close that to raise an exception to get out of streaming. I should probably file an issue w/ the
34
34
# requests library to make this easier
35
- self .resp .raw ._fp .fp ._sock .shutdown (socket .SHUT_RDWR )
36
- self .resp .raw ._fp .fp ._sock .close ()
35
+ try :
36
+ self .resp .raw ._fp .fp ._sock .shutdown (socket .SHUT_RDWR )
37
+ self .resp .raw ._fp .fp ._sock .close ()
38
+ except AttributeError :
39
+ pass
37
40
38
41
class RemoteThread (threading .Thread ):
39
42
def __init__ (self , URL , function ):
@@ -83,14 +86,19 @@ def put(URL, msg):
83
86
if response .status_code != 200 :
84
87
raise Exception (response .text )
85
88
86
- def push (URL , msg ):
89
+ def patch (URL , msg ):
87
90
to_post = json .dumps (msg )
88
- response = requests .post (firebaseURL (URL ), data = to_post )
91
+ response = requests .patch (firebaseURL (URL ), data = to_post )
89
92
if response .status_code != 200 :
90
93
raise Exception (response .text )
91
94
92
- def patch (URL , msg ):
95
+
96
+ '''
97
+ Yuck, I don't want to write documentation for this :p
98
+ def push(URL, msg):
93
99
to_post = json.dumps(msg)
94
- response = requests .patch (firebaseURL (URL ), data = to_post )
100
+ response = requests.post (firebaseURL(URL), data = to_post)
95
101
if response.status_code != 200:
96
102
raise Exception(response.text)
103
+ '''
104
+
0 commit comments