Skip to content

Instantly share code, notes, and snippets.

@ctrueden
Last active December 18, 2015 19:39
Show Gist options
  • Save ctrueden/5834247 to your computer and use it in GitHub Desktop.
Save ctrueden/5834247 to your computer and use it in GitHub Desktop.
I still don't like Python (even though I try!). I use [xpra](http://xpra.org/) via [Homebrew](http://mxcl.github.io/homebrew/), thanks to [ska-sa's awesome xpra formula](https://github.com/ska-sa/homebrew-tap). However, Apple removed the Carbon Python API, so I get an annoying stack trace whenever my xpra wants to issue a system bell. I hacked t…
File "/Users/curtis/brew/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/xpra/darwin/gui.py", line 137
def get_gtk_keymap(self):
^
IndentationError: expected an indented block
--snip--
def system_bell(self, window, device, percent, pitch, duration, bell_class, bell_id, bell_name):
import Carbon.Snd #@UnresolvedImport
Carbon.Snd.SysBeep(1)
def get_gtk_keymap(self):
return get_gtk_keymap()
--snap--
--snip--
def system_bell(self, window, device, percent, pitch, duration, bell_class, bell_id, bell_name):
# CTR: silence annoying stack trace
#import Carbon.Snd #@UnresolvedImport
#Carbon.Snd.SysBeep(1)
def get_gtk_keymap(self):
return get_gtk_keymap()
--snap--
--snip--
def system_bell(self, window, device, percent, pitch, duration, bell_class, bell_id, bell_name):
import Carbon.Snd #@UnresolvedImport
# CTR: silence annoying stack trace
#Carbon.Snd.SysBeep(1)
def get_gtk_keymap(self):
return get_gtk_keymap()
--snap--
@krupan
Copy link

krupan commented Sep 5, 2013

Python supports empty functions using the keyword pass:

def get_gtk_keymap(self):
    pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment