Skip to content

Commit 26092f8

Browse files
committed
various bad escape fixes
1 parent e59af7a commit 26092f8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

hubblestack/daemon.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def scan_proc_for_hubbles(_proc_path='/proc', hname=r'^/\S+python.*?/opt/.*?hubb
957957
kill_other=True, ksig=signal.SIGTERM):
958958
""" look for other hubble processes and kill them or sys.exit()"""
959959
no_pgrp = str(os.getpgrp())
960-
rpid = re.compile('\d+')
960+
rpid = re.compile(r'\d+')
961961
if os.path.isdir('/proc'):
962962
for dirname, dirs, _files in os.walk('/proc'):
963963
if dirname == '/proc':

tests/unittests/test_process.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def test__split_returns_list_from_string(self):
452452
ret = hubblestack.extmods.fdg.process._split("foo bar", " ", True)
453453
assert expected_ret == ret
454454
# regex
455-
ret = hubblestack.extmods.fdg.process._split("foo bar", "\s+", True)
455+
ret = hubblestack.extmods.fdg.process._split("foo bar", r"\s+", True)
456456
assert expected_ret == ret
457457
# invalid ``sep``
458458
expected_ret = ['foo bar']
@@ -487,7 +487,7 @@ def test_split_returns_list_from_string(self):
487487
expected_ret = ['a', 'b', 'c', 'd']
488488
# valid regex
489489
status, ret = hubblestack.extmods.fdg.process.split(
490-
phrase="a1b2c3d", sep="\d+", regex=True)
490+
phrase="a1b2c3d", sep=r"\d+", regex=True)
491491
assert status is True
492492
assert expected_ret == ret
493493
# simple sep
@@ -505,7 +505,7 @@ def test_split_returns_list_from_string(self):
505505
# invalid regex
506506
expected_ret = ['a1b2c3d']
507507
status, ret = hubblestack.extmods.fdg.process.split(
508-
phrase="a1b2{}", sep="\d+", regex=False, chained='c3d')
508+
phrase="a1b2{}", sep=r"\d+", regex=False, chained='c3d')
509509
assert status is False
510510
assert expected_ret == ret
511511

0 commit comments

Comments
 (0)