Skip to content

Commit 4ef989f

Browse files
committed
Refactor file path concatenation
Signed-off-by: Prasanna <iprasannamb@gmail.com>
1 parent cc21fb6 commit 4ef989f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

concoredocker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def safe_literal_eval(filename, defaultValue):
2424

2525
#9/21/22
2626
try:
27-
sparams = open(inpath+"1/concore.params").read()
27+
sparams = open(os.path.join(inpath, "1", "concore.params")).read()
2828
if sparams[0] == '"': #windows keeps "" need to remove
2929
sparams = sparams[1:]
3030
sparams = sparams[0:sparams.find('"')]
@@ -62,7 +62,7 @@ def read(port, name, initstr):
6262
global s, simtime, retrycount
6363
max_retries=5
6464
time.sleep(delay)
65-
file_path = os.path.join(inpath+str(port), name)
65+
file_path = os.path.join(inpath, str(port), name)
6666

6767
try:
6868
with open(file_path, "r") as infile:
@@ -101,7 +101,7 @@ def read(port, name, initstr):
101101

102102
def write(port, name, val, delta=0):
103103
global simtime
104-
file_path = os.path.join(outpath+str(port), name)
104+
file_path = os.path.join(outpath, str(port), name)
105105

106106
if isinstance(val, str):
107107
time.sleep(2 * delay)

0 commit comments

Comments
 (0)