wx.FileDialog not propmpting before overwriting

I’m having trouble with wx.FileDialog on OSX (wx v4.1). It seems like the following code should give a prompt before overwriting a file, but instead it just goes ahead and overwrites it. What to do?

def _SaveBitmapDialog(parent, bitmap, defaultDirectoryPath, defaultFilename):
    with wx.FileDialog(parent, "Save image as...",
                               style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT, defaultDir=defaultDirectoryPath,
                               defaultFile=defaultFilename) as fileDialog:
        if fileDialog.ShowModal() == wx.ID_CANCEL:
            return SAVE_RESULTS.CANCELED
            return _SaveBitmapToPath(bitmap, fileDialog.GetPath())

My goof… please ignore this post.

I love it when problems resolve themselves! :wink: