prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Error in alpha with built-in audacity appmod
  ### Steps to reproduce:
  
  1. open audacity.
  2. select audio. ctrl+a works.
  3. press alt+c, and press c until "compresser" is found.
  4. press enter.
  5. press tab.
  
  ### Actual behavior:
  
  ```
  ERROR - eventHandler.executeEvent (23:07:33.553):
  error executing event: gainFocus on <NVDAObjects.IAccessible.IAccessible object at 0x03318FF0> with extra args of {}
  Traceback (most recent call last):
    File "eventHandler.pyc", line 150, in executeEvent
    File "eventHandler.pyc", line 163, in doPreGainFocus
    File "api.pyc", line 109, in setFocusObject
    File "baseObject.pyc", line 46, in __get__
    File "baseObject.pyc", line 149, in _getPropertyViaCache
    File "NVDAObjects\IAccessible\__init__.pyc", line 1695, in _get_container
    File "IAccessibleHandler.pyc", line 950, in findGroupboxObject
    File "NVDAObjects\IAccessible\__init__.pyc", line 48, in getNVDAObjectFromEvent
    File "NVDAObjects\__init__.pyc", line 137, in __call__
    File "appModules\audacity.pyc", line 15, in event_NVDAObject_init
  AttributeError: 'NoneType' object has no attribute 'replace'
  ```
  
  ### Expected behavior:
  
  Items in the UI read.
  
  ### System configuration
  #### NVDA installed/portable/running from source:
  installed
  
  #### NVDA version:
  Version: alpha-18399,26485a09
  
  
  #### Windows version:
  ^10
  
  #### Name and version of other software in use when reproducing the issue:
  Audacity: 2.3.1
  
  
  
  </issue>
  <code>
  [start of source/appModules/audacity.py]
  1 # -*- coding: UTF-8 -*-
  2 #appModules/audacity.py
  3 #A part of NonVisual Desktop Access (NVDA)
  4 #Copyright (C) 2006-2018 NV Access Limited, Robert Hänggi
  5 #This file is covered by the GNU General Public License.
  6 #See the file COPYING for more details.
  7 
  8 import appModuleHandler
  9 import controlTypes
  10 
  11 class AppModule(appModuleHandler.AppModule):
  12 
  13 	def event_NVDAObject_init(self,obj):
  14 		if obj.windowClassName=="Button" and not obj.role in [controlTypes.ROLE_MENUBAR, controlTypes.ROLE_MENUITEM, controlTypes.ROLE_POPUPMENU]:
  15 			obj.name=obj.name.replace('&','')
  16
  [end of source/appModules/audacity.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/source/appModules/audacity.py b/source/appModules/audacity.py
  --- a/source/appModules/audacity.py
  +++ b/source/appModules/audacity.py
  @@ -1,9 +1,8 @@
   # -*- coding: UTF-8 -*-
  -#appModules/audacity.py
  -#A part of NonVisual Desktop Access (NVDA)
  -#Copyright (C) 2006-2018 NV Access Limited, Robert Hänggi
  -#This file is covered by the GNU General Public License.
  -#See the file COPYING for more details.
  +# A part of NonVisual Desktop Access (NVDA)
  +# Copyright (C) 2006-2019 NV Access Limited, Robert Hänggi, Łukasz Golonka
  +# This file is covered by the GNU General Public License.
  +# See the file COPYING for more details.
   
   import appModuleHandler
   import controlTypes
  @@ -11,5 +10,9 @@
   class AppModule(appModuleHandler.AppModule):
   
   	def event_NVDAObject_init(self,obj):
  -		if obj.windowClassName=="Button" and not obj.role in [controlTypes.ROLE_MENUBAR, controlTypes.ROLE_MENUITEM, controlTypes.ROLE_POPUPMENU]:
  +		if (
  +			obj.windowClassName == "Button"
  +			and obj.role not in [controlTypes.ROLE_MENUBAR, controlTypes.ROLE_MENUITEM, controlTypes.ROLE_POPUPMENU]
  +			and obj.name is not None
  +		):
   			obj.name=obj.name.replace('&','')
  
verification_info: {"golden_diff": "diff --git a/source/appModules/audacity.py b/source/appModules/audacity.py\n--- a/source/appModules/audacity.py\n+++ b/source/appModules/audacity.py\n@@ -1,9 +1,8 @@\n # -*- coding: UTF-8 -*-\r\n-#appModules/audacity.py\r\n-#A part of NonVisual Desktop Access (NVDA)\r\n-#Copyright (C) 2006-2018 NV Access Limited, Robert H\u00e4nggi\r\n-#This file is covered by the GNU General Public License.\r\n-#See the file COPYING for more details.\r\n+# A part of NonVisual Desktop Access (NVDA)\r\n+# Copyright (C) 2006-2019 NV Access Limited, Robert H\u00e4nggi, \u0141ukasz Golonka\r\n+# This file is covered by the GNU General Public License.\r\n+# See the file COPYING for more details.\r\n \r\n import appModuleHandler\r\n import controlTypes\r\n@@ -11,5 +10,9 @@\n class AppModule(appModuleHandler.AppModule):\r\n \r\n \tdef event_NVDAObject_init(self,obj):\r\n-\t\tif obj.windowClassName==\"Button\" and not obj.role in [controlTypes.ROLE_MENUBAR, controlTypes.ROLE_MENUITEM, controlTypes.ROLE_POPUPMENU]:\r\n+\t\tif (\r\n+\t\t\tobj.windowClassName == \"Button\"\r\n+\t\t\tand obj.role not in [controlTypes.ROLE_MENUBAR, controlTypes.ROLE_MENUITEM, controlTypes.ROLE_POPUPMENU]\r\n+\t\t\tand obj.name is not None\r\n+\t\t):\r\n \t\t\tobj.name=obj.name.replace('&','')\n", "issue": "Error in alpha with built-in audacity appmod\n### Steps to reproduce:\r\n\r\n1. open audacity.\r\n2. select audio. ctrl+a works.\r\n3. press alt+c, and press c until \"compresser\" is found.\r\n4. press enter.\r\n5. press tab.\r\n\r\n### Actual behavior:\r\n\r\n```\r\nERROR - eventHandler.executeEvent (23:07:33.553):\r\nerror executing event: gainFocus on <NVDAObjects.IAccessible.IAccessible object at 0x03318FF0> with extra args of {}\r\nTraceback (most recent call last):\r\n  File \"eventHandler.pyc\", line 150, in executeEvent\r\n  File \"eventHandler.pyc\", line 163, in doPreGainFocus\r\n  File \"api.pyc\", line 109, in setFocusObject\r\n  File \"baseObject.pyc\", line 46, in __get__\r\n  File \"baseObject.pyc\", line 149, in _getPropertyViaCache\r\n  File \"NVDAObjects\\IAccessible\\__init__.pyc\", line 1695, in _get_container\r\n  File \"IAccessibleHandler.pyc\", line 950, in findGroupboxObject\r\n  File \"NVDAObjects\\IAccessible\\__init__.pyc\", line 48, in getNVDAObjectFromEvent\r\n  File \"NVDAObjects\\__init__.pyc\", line 137, in __call__\r\n  File \"appModules\\audacity.pyc\", line 15, in event_NVDAObject_init\r\nAttributeError: 'NoneType' object has no attribute 'replace'\r\n```\r\n\r\n### Expected behavior:\r\n\r\nItems in the UI read.\r\n\r\n### System configuration\r\n#### NVDA installed/portable/running from source:\r\ninstalled\r\n\r\n#### NVDA version:\r\nVersion: alpha-18399,26485a09\r\n\r\n\r\n#### Windows version:\r\n^10\r\n\r\n#### Name and version of other software in use when reproducing the issue:\r\nAudacity: 2.3.1\r\n\r\n\n", "before_files": [{"content": "# -*- coding: UTF-8 -*-\r\n#appModules/audacity.py\r\n#A part of NonVisual Desktop Access (NVDA)\r\n#Copyright (C) 2006-2018 NV Access Limited, Robert H\u00e4nggi\r\n#This file is covered by the GNU General Public License.\r\n#See the file COPYING for more details.\r\n\r\nimport appModuleHandler\r\nimport controlTypes\r\n\r\nclass AppModule(appModuleHandler.AppModule):\r\n\r\n\tdef event_NVDAObject_init(self,obj):\r\n\t\tif obj.windowClassName==\"Button\" and not obj.role in [controlTypes.ROLE_MENUBAR, controlTypes.ROLE_MENUITEM, controlTypes.ROLE_POPUPMENU]:\r\n\t\t\tobj.name=obj.name.replace('&','')\r\n", "path": "source/appModules/audacity.py"}]}