title: AttributeError 'nonetype' object has no attribute 'recv'
body: <p>First of all I need to say I've never tried coding in python before... </p>
  
  <p>I'm trying to make a Twitch IRC bot working but I keep failing... </p>
  
  <p>My bot.py code looks like this: </p>
  
  <pre><code>from src.lib import irc as irc_
  
  from src.lib import functions_general
  
  from src.lib import functions_commands as commands
  
  from src.config import config
  
  class PartyMachine:
  
      def __init__(self, config):
          self.config = config
          self.irc = irc_.irc(config)
          self.socket = self.irc.get_irc_socket_object()
  
  
      def sock(self):
          irc = self.irc
          sock = self.socket
          config = self.config
          kage = sock
  
          while True:
              data = sock.recv(2048).rstrip()
  
              if len(data) == 0:
                  pp('Connection was lost, reconnecting.')
                  sock = self.irc.get_irc_socket_object()
  
              if config['debug']:
                  print (data)
  </code></pre>
  
  <p>my config.py is here:</p>
  
  <pre><code>'socket_buffer_size': 1024
  </code></pre>
  
  <p>My irc.py is here:</p>
  
  <pre><code>def get_irc_socket_object(self):
      sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      sock.settimeout(10)
  
      self.sock = sock
  
      try:
          sock.connect((self.config['server'], self.config['port']))
      except:
          pp('Cannot connect to server (%s:%s).' % (self.config['server'], self.config['port']), 'error')
          sys.exit()
  
      sock.settimeout(None)
  def sock_send(sock, send, self):
      sock.send('USER %s\r\n' % self.config['username'], sock.encode('utf-8'), send.encode('utf-8'))
      sock.send('PASS %s\r\n' % self.config['oauth_password'])
      sock.send('NICK %s\r\n' % self.config['username'])
  
      if self.check_login_status(sock.recv(1024)):
          pp('Login successful.')
      else:
          pp('Login unsuccessful. (hint: make sure your oauth token is set in self.config/self.config.py).', 'error')
          sys.exit()
  </code></pre>
  
  <p>and my serve.py is here:</p>
  
  <pre><code>from sys import argv
  from src.bot import *
  from src.config.config import *
  
  bot = PartyMachine(config).sock()
  </code></pre>
  
  <p>It keeps failing with "<code>AttributeError 'nonetype' object has no attribute 'recv'</code>". How can this be ? </p>