Commits

Maciej Fijalkowski committed 562d2c9

at the very least don't break importing rpython on top of pypy

Comments (0)

Files changed (1)

rpython/rtyper/module/ll_os.py

         from rpython.rtyper.module import ll_os_stat
         return ll_os_stat.register_stat_variant('lstat', traits)
 
-    @registering(os.fstatvfs)
+    @registering_if(os, 'fstatvfs')
     def register_os_fstatvfs(self):
         from rpython.rtyper.module import ll_os_stat
         return ll_os_stat.register_statvfs_variant('fstatvfs', StringTraits())
 
-    @registering_str_unicode(os.statvfs)
-    def register_os_statvfs(self, traits):
-        from rpython.rtyper.module import ll_os_stat
-        return ll_os_stat.register_statvfs_variant('statvfs', traits)
+    if hasattr(os, 'statvfs'):
+        @registering_str_unicode(os.statvfs)
+        def register_os_statvfs(self, traits):
+            from rpython.rtyper.module import ll_os_stat
+            return ll_os_stat.register_statvfs_variant('statvfs', traits)
 
 
     # ------------------------------- os.W* ---------------------------------