Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
This commit is contained in:
dev2718 2022-01-13 15:33:41 +01:00 committed by GitHub
parent df1f215f92
commit cee33bbd7e
Failed to generate hash of commit
2 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,23 @@
**Added:**
* <news item>
**Changed:**
* <news item>
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* If a .xsh file is imported, the resulting module will now always have an absolute \_\_file\_\_ attribute to be consistent with pythons behavior since python 3.4.
**Security:**
* <news item>

View file

@ -75,7 +75,7 @@ class XonshImportHook(MetaPathFinder, SourceLoader):
if fname not in {x.name for x in os.scandir(p)}:
continue
spec = ModuleSpec(fullname, self)
self._filenames[fullname] = os.path.join(p, fname)
self._filenames[fullname] = os.path.abspath(os.path.join(p, fname))
break
return spec