Skip to content

Commit

Permalink
Revert "Update utils.py"
Browse files Browse the repository at this point in the history
This reverts commit 7c84926.
  • Loading branch information
Aayush-Goel-04 committed Sep 6, 2023
1 parent 7c84926 commit c1f9e72
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions capa/render/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
import io
import sys
import gzip
import json
from typing import Dict, Union, Iterator
Expand Down Expand Up @@ -60,11 +59,8 @@ def capability_rules(doc: rd.ResultDocument) -> Iterator[rd.RuleMatches]:


def load_rules_prevalence() -> Dict[str, str]:
if hasattr(sys, "frozen") and hasattr(sys, "_MEIPASS"):
file = Path(sys._MEIPASS) / "assets" / "rules_prevalence.json.gz" # type: ignore
else:
CD = Path(__file__).resolve().parent.parent.parent
file = CD / "assets" / "rules_prevalence.json.gz"
CD = Path(__file__).resolve().parent.parent.parent
file = CD / "assets" / "rules_prevalence.json.gz"
if not file.exists():
raise FileNotFoundError(f"File '{file}' not found.")
try:
Expand Down

0 comments on commit c1f9e72

Please sign in to comment.