mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-06 09:07:13 -04:00
Fixed potential variable undefined errors
Former-commit-id: 65168e24ed228816d4089241d4086317488fd696 Former-commit-id: 5c46855d45488b2ec5fd8b53040237fc224b45d4
This commit is contained in:
@@ -3,7 +3,7 @@ import re
|
||||
from sys import argv, exit as s_exit
|
||||
|
||||
# read arguments
|
||||
arguments = argv[1:]
|
||||
arguments, replacement = argv[1:], None
|
||||
|
||||
# define replacement text depending on arguments
|
||||
if len(arguments) > 0:
|
||||
|
||||
+3
-1
@@ -3,7 +3,7 @@ import re
|
||||
from sys import argv, exit as s_exit
|
||||
|
||||
# read arguments
|
||||
arguments = argv[1:]
|
||||
arguments, replacement = argv[1:], None
|
||||
|
||||
# define replacement text depending on arguments
|
||||
if len(arguments) > 0:
|
||||
@@ -25,6 +25,8 @@ for target in targets:
|
||||
# determine text to end regex with
|
||||
if target[2] == '':
|
||||
regend = '\n'
|
||||
else:
|
||||
regend = ''
|
||||
# compile regex and modify text
|
||||
regex = re.compile(f"# PORT START {target[0]}.*?# PORT END {target[0]}{regend}", re.DOTALL)
|
||||
new_text = re.sub(regex, target[2], text)
|
||||
|
||||
Reference in New Issue
Block a user