Skip to content

Commit c639214

Browse files
committed
removed broken getVersion and added info to changelog
1 parent 949a6ce commit c639214

4 files changed

Lines changed: 6 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.0.4
2+
* added getVersionSync
3+
14
## 0.0.3
25
* fixed buffering in `PythonShell.receive`, fixing [#1](https://github.com/extrabacon/python-shell/issues/1)
36

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Promise is rejected if there is a syntax error.
275275
Checks the syntax of the file and returns a promise.
276276
Promise is rejected if there is a syntax error.
277277

278-
#### `version(pythonPath?:string)`
278+
#### `getVersionSync(pythonPath?:string)`
279279

280280
Returns the python version. Optional pythonPath param to get the version
281281
of a specific python interpreter.

index.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export class PythonShell extends EventEmitter{
213213
}
214214
};
215215

216-
/**
216+
/**
217217
* checks syntax without executing code
218218
* @param {string} code
219219
* @returns {Promise} rejects w/ stderr if syntax failure
@@ -284,13 +284,8 @@ export class PythonShell extends EventEmitter{
284284
return PythonShell.run(filePath, options, callback);
285285
};
286286

287-
static getVersion(pythonPath?:string){
288-
if(!pythonPath) pythonPath == this.defaultPythonPath
289-
let execPromise = promisify(exec)
290-
return execPromise(pythonPath + " --version")
291-
}
292-
293287
static getVersionSync(pythonPath?:string){
288+
if(!pythonPath) pythonPath = this.defaultPythonPath
294289
return execSync(pythonPath + " --version").toString()
295290
}
296291

test/test-python-shell.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,6 @@ describe('PythonShell', function () {
7878
})
7979
})
8080

81-
describe("#getVersion", function(){
82-
it('should return a string', function(done){
83-
PythonShell.getVersion().then(version => {
84-
console.log(version)
85-
version.stdout.should.be.a.String();
86-
version.stdout.length.should.be.greaterThan(0)
87-
done()
88-
})
89-
})
90-
})
91-
9281
describe("#getVersionSync", function(){
9382
it('should return a string', function(){
9483
const version = PythonShell.getVersionSync()

0 commit comments

Comments
 (0)