title: Issue with global variable when passing into another if statment
body: <p>I am trying to get Ardinput to pass into the <code>if "(Ardinput == stagecode):"</code> but it seems like Ardinput loses it's contents </p>
  
  <p>here is my output for the code</p>
  
  <pre><code>Start capture
  b'STAGE\r\n'
  STAGE
   Befor CR
  STAGE
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>url = config.url()
  
  stagecode = "STAGE "
  
  ser = serial.Serial(
   port='COM3',
   baudrate=9600, 
  )
  
  def stage():
      urllib.request.urlopen(url + 'f.stage')
  
  def capture():
      global Ardinput
      print ("Start capture")
      while (1):           
          line = ser.readline()
          if (line != ""):
              print (line)
              Ardinput = line
              Ardinput = Ardinput.decode("utf-8")
              print (Ardinput + ' Befor CR')
              Ardinput = Ardinput[:-1]
              print (Ardinput)
              if (Ardinput == stagecode):       
                  print (stagecode + ' IN IF FUNCTION')
                  stage()
  capture()
  </code></pre>