summaryrefslogtreecommitdiffhomepage
path: root/demo.py
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2005-04-18 00:11:34 +0000
committerRobey Pointer <robey@lag.net>2005-04-18 00:11:34 +0000
commit29a5381ba17c5c93e7ed5c07a4ece223a8ed0b66 (patch)
tree124202f3b822b99bdb98f806767c56b2f148ee89 /demo.py
parent18aaff8521d1d5eb6739c1d53686b1de326b8300 (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-xdemo.py4
1 files changed, 3 insertions, 1 deletions
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')