return bytes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-04-25 18:29:00 +02:00
parent b70c214584
commit b6d46ea1bf
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -72,11 +72,14 @@ class Executor:
f.close()
return currenctfile
def getFileInCurrentDirectory(self, file: str):
def getFileInCurrentDirectory(self, file: str) -> bytes:
file = self.sanitizeFile(file)
currentfile = os.path.join(self.currentDirectory, file)
if os.path.exists(currentfile):
return open(currentfile, "r")
f = open(currentfile, "rb")
content = f.read()
f.close()
return content
else:
raise Exception('File not found')