Skip to content

Commit dd9beee

Browse files
committed
clean_string -> clear_string
1 parent e7a0a79 commit dd9beee

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

vk_api/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def search_re(reg, string):
2424
return groups[0]
2525

2626

27-
def clean_string(s):
27+
def clear_string(s):
2828
if s:
2929
return s.strip().replace(' ', '')
3030

vk_api/vk_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import jconfig
1818
from .exceptions import *
1919
from .utils import (
20-
code_from_number, search_re, clean_string,
20+
code_from_number, search_re, clear_string,
2121
cookies_to_list, set_cookies_from_list
2222
)
2323

@@ -320,11 +320,11 @@ def security_check(self, response=None):
320320
self.logger.info('Security check is not required')
321321
return response
322322

323-
phone_prefix = clean_string(search_re(RE_PHONE_PREFIX, response.text))
324-
phone_postfix = clean_string(search_re(RE_PHONE_POSTFIX, response.text))
323+
phone_prefix = clear_string(search_re(RE_PHONE_PREFIX, response.text))
324+
phone_postfix = clear_string(search_re(RE_PHONE_POSTFIX, response.text))
325325

326326
code = None
327-
if self.login:
327+
if self.login and phone_prefix and phone_postfix:
328328
code = code_from_number(phone_prefix, phone_postfix, self.login)
329329

330330
if code:

0 commit comments

Comments
 (0)