File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -89,27 +89,30 @@ def _unasync_tokens(self, tokens):
89
89
skip_next = True
90
90
else :
91
91
if token .name == "NAME" :
92
- token = token ._replace (src = self ._unasync_name (token .src ))
92
+ token = token ._replace (src = self .unasync_name (token .src ))
93
93
elif token .name == "STRING" :
94
- left_quote , name , right_quote = (
94
+ left_quote , string , right_quote = (
95
95
token .src [0 ],
96
96
token .src [1 :- 1 ],
97
97
token .src [- 1 ],
98
98
)
99
99
token = token ._replace (
100
- src = left_quote + self ._unasync_name ( name ) + right_quote
100
+ src = left_quote + self .unasync_string ( string ) + right_quote
101
101
)
102
102
103
103
yield token
104
104
105
- def _unasync_name (self , name ):
105
+ def unasync_name (self , name ):
106
106
if name in self .token_replacements :
107
107
return self .token_replacements [name ]
108
108
# Convert classes prefixed with 'Async' into 'Sync'
109
109
elif len (name ) > 5 and name .startswith ("Async" ) and name [5 ].isupper ():
110
110
return "Sync" + name [5 :]
111
111
return name
112
112
113
+ def unasync_string (self , string ):
114
+ return self .unasync_name (string )
115
+
113
116
114
117
def unasync_files (fpath_list , rules ):
115
118
for f in fpath_list :
You can’t perform that action at this time.
0 commit comments