Read .pronsolerc from current directory if not found in home directory

master
Keegi 2011-06-25 11:03:01 +03:00
parent 83d593ee11
commit 2810993f06
1 changed files with 4 additions and 1 deletions

View File

@ -180,7 +180,10 @@ class pronsole(cmd.Cmd):
def load_rc(self,rc_filename=".pronsolerc"):
self.processing_rc=True
try:
rc=open(os.path.join(os.path.expanduser("~"),rc_filename))
try:
rc=open(os.path.join(os.path.expanduser("~"),rc_filename))
except IOError:
rc=open(rc_filename)
for rc_cmd in rc:
if not rc_cmd.lstrip().startswith("#"):
self.onecmd(rc_cmd)