[Checkins] SVN: z3c.filetype/trunk/src/z3c/filetype/magic.py Move nix specific import into existing try/except

Roger Ineichen roger at projekt01.ch
Wed Aug 16 12:57:33 EDT 2006


Log message for revision 69568:
  Move nix specific import into existing try/except

Changed:
  U   z3c.filetype/trunk/src/z3c/filetype/magic.py

-=-
Modified: z3c.filetype/trunk/src/z3c/filetype/magic.py
===================================================================
--- z3c.filetype/trunk/src/z3c/filetype/magic.py	2006-08-16 16:54:51 UTC (rev 69567)
+++ z3c.filetype/trunk/src/z3c/filetype/magic.py	2006-08-16 16:57:32 UTC (rev 69568)
@@ -1,7 +1,7 @@
 # Found on a russian zope mailing list, and modified to fix bugs in parsing
 # the magic file and string making
 # -- Daniel Berlin <dberlin at dberlin.org>
-import sys, struct, time, re, exceptions, pprint, stat, os,  grp
+import sys, struct, time, re, exceptions, pprint, stat, os
 
 _mew = 0
 
@@ -515,6 +515,7 @@
 
 def groupname(gid):
     try:
+        import grp
         return grp.getgrgid( gid )[0]
     except:
         return '#%s'%gid



More information about the Checkins mailing list