(self, shell=None, **kwargs)
| 38 | ).tag(config=True) |
| 39 | |
| 40 | def __init__(self, shell=None, **kwargs): |
| 41 | |
| 42 | # Now define isexec in a cross platform manner. |
| 43 | self.is_posix = False |
| 44 | self.execre = None |
| 45 | if os.name == 'posix': |
| 46 | self.is_posix = True |
| 47 | else: |
| 48 | try: |
| 49 | winext = os.environ['pathext'].replace(';','|').replace('.','') |
| 50 | except KeyError: |
| 51 | winext = 'exe|com|bat|py' |
| 52 | try: |
| 53 | self.execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE) |
| 54 | except re.error: |
| 55 | warn("Seems like your pathext environmental " |
| 56 | "variable is malformed. Please check it to " |
| 57 | "enable a proper handle of file extensions " |
| 58 | "managed for your system") |
| 59 | winext = 'exe|com|bat|py' |
| 60 | self.execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE) |
| 61 | |
| 62 | # call up the chain |
| 63 | super().__init__(shell=shell, **kwargs) |
| 64 | |
| 65 | |
| 66 | @skip_doctest |
nothing calls this directly
no outgoing calls
no test coverage detected