diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index 8e83304..0bd8446 100644
a
|
b
|
|
1 | 1 | import collections |
| 2 | import fnmatch |
2 | 3 | import os |
3 | 4 | import sys |
4 | 5 | from optparse import OptionParser, NO_DEFAULT |
… |
… |
def find_commands(management_dir):
|
25 | 26 | """ |
26 | 27 | command_dir = os.path.join(management_dir, 'commands') |
27 | 28 | try: |
28 | | return [f[:-3] for f in os.listdir(command_dir) |
29 | | if not f.startswith('_') and f.endswith('.py')] |
| 29 | return [os.path.splitext(f)[0] for f in fnmatch.filter( |
| 30 | os.listdir(command_dir), '[!_]*.py[co]')] |
30 | 31 | except OSError: |
31 | 32 | return [] |
32 | 33 | |