@@ -168,7 +168,7 @@ pub(super) mod _os {
168168 ospath:: { IOErrorBuilder , OsPath , OsPathOrFd , OutputMode } ,
169169 protocol:: PyIterReturn ,
170170 recursion:: ReprGuard ,
171- types:: { IterNext , Iterable , PyStructSequence , Representable , SelfIter } ,
171+ types:: { IterNext , Iterable , PyStructSequence , Representable , SelfIter , Unconstructible } ,
172172 utils:: ToCString ,
173173 vm:: VirtualMachine ,
174174 } ;
@@ -474,7 +474,7 @@ pub(super) mod _os {
474474 ino : AtomicCell < Option < u64 > > ,
475475 }
476476
477- #[ pyclass( with( Representable ) ) ]
477+ #[ pyclass( with( Representable , Unconstructible ) ) ]
478478 impl DirEntry {
479479 #[ pygetset]
480480 fn name ( & self , vm : & VirtualMachine ) -> PyResult {
@@ -652,6 +652,7 @@ pub(super) mod _os {
652652 }
653653 }
654654 }
655+ impl Unconstructible for DirEntry { }
655656
656657 #[ pyattr]
657658 #[ pyclass( name = "ScandirIter" ) ]
@@ -661,7 +662,7 @@ pub(super) mod _os {
661662 mode : OutputMode ,
662663 }
663664
664- #[ pyclass( with( IterNext , Iterable ) ) ]
665+ #[ pyclass( with( IterNext , Iterable , Unconstructible ) ) ]
665666 impl ScandirIterator {
666667 #[ pymethod]
667668 fn close ( & self ) {
@@ -679,6 +680,7 @@ pub(super) mod _os {
679680 zelf. close ( )
680681 }
681682 }
683+ impl Unconstructible for ScandirIterator { }
682684 impl SelfIter for ScandirIterator { }
683685 impl IterNext for ScandirIterator {
684686 fn next ( zelf : & crate :: Py < Self > , vm : & VirtualMachine ) -> PyResult < PyIterReturn > {
0 commit comments