diff options
author | Robey Pointer <robey@lag.net> | 2005-04-18 00:11:34 +0000 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2005-04-18 00:11:34 +0000 |
commit | 29a5381ba17c5c93e7ed5c07a4ece223a8ed0b66 (patch) | |
tree | 124202f3b822b99bdb98f806767c56b2f148ee89 /demo.py | |
parent | 18aaff8521d1d5eb6739c1d53686b1de326b8300 (diff) |
[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.
Diffstat (limited to 'demo.py')
-rwxr-xr-x | demo.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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') |