Skip to content

Commit

Permalink
fix: 修复python23兼容问题
Browse files Browse the repository at this point in the history
  • Loading branch information
feng626 committed Nov 1, 2021
1 parent 9477928 commit 7f105a5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Windows/JumpServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
import platform
import subprocess

# 兼容python 2, 3
try:
reload(sys)
sys.setdefaultencoding('utf-8')
except Exception:
pass

'''
{
"filename": "{}-{}-jumpserver".format(username, name),
Expand All @@ -23,7 +30,7 @@ def remove_current_rdp_file():
re_rdp_file = re.compile(r'.*\.rdp$')
for filename in os.listdir(BASE_DIR):
if re_rdp_file.search(filename):
os.remove(os.path.join(filename))
os.remove(os.path.join(BASE_DIR, filename))


class Rouse(object):
Expand Down

0 comments on commit 7f105a5

Please sign in to comment.