• 카테고리

    질문 & 답변
  • 세부 분야

    금융 · 재테크

  • 해결 여부

    미해결

'NoneType' object is not subscriptable 오류 문의 (robobits.py)

22.07.07 01:56 작성 조회수 126

0

안녕하세요, 강사님

robobits.py 파일에서 TypeError: 'NoneType' object is not subscriptable 오류가 발생하여 문의 드립니다.

아래 코드로도 수정 했지만 해결이 되지 않네요.... 지정가 매수 함수에서만 에러가 나는건지 궁금합니다.

def buy_limit_order(up, coin_name, price, amt):

    message = ''

    uuid = 'none'

    result = {'uuid': ''}

 

    try: 

        result = up.buy_limit_order(coin_name, price, amt)

    except:

        message = "{}".format(sys.exc_info())

 

    try: #error message check

        message = result['error']['message']

    except: #no error message -> normal state

        if message == '':

            message = 'good'            

            try:

                uuid = result['uuid']

            except: 

                message = 'unknown error'

                uuid = ''

    return message, uuid

바쁘시겠지만 답변 부탁 드립니다.

 

감사합니다.

답변 1

답변을 작성해보세요.

0

안녕하세요 dh.yang83님.

먼저 강의를 수강해주셔서 감사합니다.

보내주신 오류 메시지만 보고 원인을 파악하기가 힘듭니다. 사용하시는 전체 코드를 메일로 보내주시면 제가 디버깅 해보고 원인을 파악해서 알려드리겠습니다.

multicore.it@gmail.com  으로 메일 부탁드립니다.

감사합니다.