Skip to content

Commit

Permalink
fix: unitest issues
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram committed Jan 8, 2025
1 parent d0c78f2 commit c80ff28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xmodule/x_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from opaque_keys.edx.asides import AsideDefinitionKeyV2, AsideUsageKeyV2
from opaque_keys.edx.keys import UsageKey
from importlib.resources import files, as_file
from pathlib import Path
from pathlib import Path as P
from web_fragments.fragment import Fragment
from webob import Response
from webob.multidict import MultiDict
Expand Down Expand Up @@ -874,9 +874,9 @@ def get_template_dirpaths(cls):
template_dirpaths = []
template_dirname = cls.get_template_dir()
package, module_path = __name__.split('.', 1)
module_dir = str(Path(module_path).parent)
file_dirs = files(package).joinpath(module_dir, template_dirname)

module_dir = str(P(module_path).parent)
module_dir = "" if module_dir == "." else module_dir
file_dirs = files(package).joinpath(module_dir, template_dirname or "")
if template_dirname and file_dirs.is_dir():
with as_file(file_dirs) as path:
template_dirpaths.append(path)
Expand Down

0 comments on commit c80ff28

Please sign in to comment.