From 67a4e515e48f0312434bd7997cb7af91298a572f Mon Sep 17 00:00:00 2001 From: Guillaume Chazarain Date: Tue, 13 May 2008 14:07:39 +0200 Subject: [PATCH] More robust .py finding, in case the compiled file does not end un .pyc --- gsh/file_transfer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gsh/file_transfer.py b/gsh/file_transfer.py index 2815165..c16b915 100644 --- a/gsh/file_transfer.py +++ b/gsh/file_transfer.py @@ -31,9 +31,11 @@ CMD_RECEIVE = CMD_PREFIX + 'receive "%s" "%s"\n' def base64version(module): path = module.__file__ - if path.endswith('.pyc'): + if not path.endswith('.py'): # Read from the .py source file - path = path[:-1] + dot_py_start = path.find('.py') + if dot_py_start >= 0: + path = path[:dot_py_start+3] python_lines = [] for line in file(path): hash_pos = line.find(chr(35)) -- 2.11.4.GIT