()
| 4 | |
| 5 | |
| 6 | def get_version(): |
| 7 | node_version_h = os.path.join( |
| 8 | os.path.dirname(__file__), |
| 9 | '..', |
| 10 | 'src', |
| 11 | 'node_version.h') |
| 12 | |
| 13 | f = open(node_version_h) |
| 14 | |
| 15 | regex = '^#define NODE_MODULE_VERSION [0-9]+' |
| 16 | |
| 17 | for line in f: |
| 18 | if re.match(regex, line): |
| 19 | major = line.split()[2] |
| 20 | return major |
| 21 | |
| 22 | raise Exception('Could not find pattern matching %s' % regex) |
| 23 | |
| 24 | |
| 25 | if __name__ == '__main__': |
no test coverage detected
searching dependent graphs…