瀏覽代碼

refactor imports in Attack/__init__.py

Jens Keim 7 年之前
父節點
當前提交
e39010f815
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      code/Attack/__init__.py

+ 3 - 3
code/Attack/__init__.py

@@ -1,10 +1,10 @@
 import glob
-from os.path import dirname, basename
+import os.path as osp
 
 # Create a list consisting of all attack classes names in this package
 __all__ = []
-modules = glob.glob(dirname(__file__) + "/*.py")
+modules = glob.glob(osp.dirname(__file__) + "/*.py")
 for m in modules:
-    c = str(basename(m)[:-3])
+    c = str(osp.basename(m)[:-3])
     if not c.startswith('__') and not c.startswith('Base') and c.endswith('Attack'):
         __all__.append(c)