This repository was archived by the owner on Dec 10, 2018. It is now read-only.
File tree 3 files changed +8
-3
lines changed
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 4
4
import functools
5
5
import hashlib
6
6
import itertools
7
+ import os .path
7
8
import pickle
8
9
import types
9
10
@@ -115,7 +116,8 @@ def load(thrift_file, cache=True):
115
116
if thrift_file in _thriftloader :
116
117
return _thriftloader [thrift_file ]
117
118
118
- module_name = thrift_file [:thrift_file .find ('.' )]
119
+ basename = os .path .basename (thrift_file )
120
+ module_name , _ = os .path .splitext (basename )
119
121
120
122
with open (thrift_file , "r" ) as fp :
121
123
schema = fp .read ()
Original file line number Diff line number Diff line change @@ -56,8 +56,8 @@ class TThreadedServer(TServer):
56
56
"""Threaded server that spawns a new thread per each connection."""
57
57
58
58
def __init__ (self , * args , ** kwargs ):
59
- TServer . __init__ ( self , * args )
60
- self . daemon = kwargs . get ( "daemon" , False )
59
+ self . daemon = kwargs . pop ( "daemon" , False )
60
+ TServer . __init__ ( self , * args , ** kwargs )
61
61
62
62
def serve (self ):
63
63
self .trans .listen ()
Original file line number Diff line number Diff line change @@ -108,6 +108,9 @@ def __getattr__(self, api):
108
108
if api in self ._service .thrift_services :
109
109
return functools .partial (self ._req , api )
110
110
111
+ raise AttributeError ("{} instance has no attribute '{}'" .format (
112
+ self .__class__ .__name__ , api ))
113
+
111
114
def __dir__ (self ):
112
115
return self ._service .thrift_services
113
116
You can’t perform that action at this time.
0 commit comments