diff --git a/yara_service/__init__.py b/yara_service/__init__.py index abe44f5a..f3934beb 100644 --- a/yara_service/__init__.py +++ b/yara_service/__init__.py @@ -163,10 +163,10 @@ def _compile_rules(sigdir, sigfiles, sfpath=""): sfname = str(os.path.basename(sfpath)) sfext = str(os.path.splitext(sfname)) old = os.getcwd() + os.chdir(dirname) try: with open(sigfile, "rt") as f: data = f.read() - os.chdir(dirname) except Exception as e: logger.exception("File cannot be opened: %s" % sigfile) raise ServiceConfigError(str(e))