Fix cherry-pick.py script for non-release branches

Change-Id: I6ff6b2e2deee3ef6b321fea6d545ebff44d8944c
diff --git a/tools/cherry-pick.py b/tools/cherry-pick.py
index 4a9bca0..da68de5 100755
--- a/tools/cherry-pick.py
+++ b/tools/cherry-pick.py
@@ -76,7 +76,7 @@
             break
 
     new_version = 'unknown'
-    if old_version.find('.') > 0:
+    if old_version.find('.') > 0 and old_version.find('-') == -1:
         split_version = old_version.split('.')
         new_version = '.'.join(split_version[:-1] +
                                [str(int(split_version[-1]) + 1)])
@@ -90,10 +90,9 @@
             editor = os.environ.get('EDITOR')
         if not editor:
             editor = 'vi'
-        else:
-            print("Opening %s for version update with %s" %
-                  (VERSION_FILE, editor))
-            subprocess.run([editor, VERSION_FILE])
+        print("Opening %s for version update with %s" %
+              (VERSION_FILE, editor))
+        subprocess.run([editor, VERSION_FILE])
 
     message = ("Version %s\n\n" % new_version)
     for bug in sorted(bugs):