diff --git a/nbformat/corpus/words.py b/nbformat/corpus/words.py index 9916a5a5..6afba05d 100644 --- a/nbformat/corpus/words.py +++ b/nbformat/corpus/words.py @@ -1,18 +1,18 @@ +import os import random -from pathlib import Path from functools import lru_cache @lru_cache(1) def acceptable_nouns(): - with open(Path(__file__).parent / 'nouns.txt', 'r') as nouns_file: + with open(os.path.join(os.path.dirname(__file__), 'nouns.txt'), 'r') as nouns_file: return set(word.rstrip() for word in nouns_file.readlines()) @lru_cache(1) def acceptable_adjectives(): - with open(Path(__file__).parent / 'adjectives.txt', 'r') as adjectives_file: + with open(os.path.join(os.path.dirname(__file__), 'adjectives.txt'), 'r') as adjectives_file: return set(word.rstrip() for word in adjectives_file.readlines())