From 29a5381ba17c5c93e7ed5c07a4ece223a8ed0b66 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Mon, 18 Apr 2005 00:11:34 +0000 Subject: [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-162] avoid os.environ['HOME'] in the demos avoid using os.environ['HOME'], which will never work on windows, and use os.path.expanduser() instead. it's semi-moot because windows doesn't have a standard location for ssh files, but i think paramiko should set a good example anyway. --- demo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'demo.py') diff --git a/demo.py b/demo.py index 0754fd72..691b6f9b 100755 --- a/demo.py +++ b/demo.py @@ -25,7 +25,9 @@ import paramiko ##### utility functions def load_host_keys(): - filename = os.environ['HOME'] + '/.ssh/known_hosts' + # this file won't exist on windows, but windows doesn't have a standard + # location for this file anyway. + filename = os.path.expanduser('~/.ssh/known_hosts') keys = {} try: f = open(filename, 'r') -- cgit v1.2.3