Permalink
Browse files

Don't assume `whoami` exists

Solaris doesn't have a `whoami` command.
  • Loading branch information...
1 parent a576267 commit cbcab980941567cafcf083d93f865c4a47340836 @jdemeyer jdemeyer committed with kini Mar 11, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 sagenb/notebook/sage_email.py
@@ -40,8 +40,9 @@ def default_email_address():
'...@...'
"""
import socket
+ import getpass
hostname = socket.gethostname()
- username = os.popen('whoami').read().strip()
+ username = getpass.getuser()
return '%s@%s'%(username, hostname)
def email(to, subject, body = '', from_address = None, verbose = True, block = False, kill_on_exit = False):

0 comments on commit cbcab98

Please sign in to comment.